```ruby
class Object
  def to_logstash
    respond_to?(:to_s) ? to_s : inspect
  end
end

...

hash.merge!('@message' => message.to_logstash)
```