Open arianf opened 2 years ago
In the meantime, I have the following workout which is not great:
customize_event: lambda do |event|
event.instance_variable_set(
:@data,
{ timestamp: event.timestamp.iso8601(6) }.merge(event.instance_variable_get(:@data))
)
end
timestamp
should be the first thing in the hash, given that splunk will only parse by default the first 128 characters of a json MAX_TIMESTAMP_LOOKAHEAD default is 128Since message is almost always a variable length, and timestamp is always a fixed length, I think by default the order of timestamp should be first in the ruby hash.
https://github.com/dwbutler/logstash-logger/blob/b8f5403c44150f10d15b01133f8b6d1e9eb31806/lib/logstash-logger/formatter/base.rb#L30-L43
could be rewritten to: