Closed ayashjorden closed 7 years ago
Hello, First, this gem is awesome! we're using it in production for a long time :)
I'm looking for a way to rename fields (avoid doing it in logstash, getting faster event flow to ES). One way is:
FIELD_RENAMING = { 'ip' => 'true_ip', 'path' => 'request', 'status' => 'response' } ..... some other code ..... def self.log_event(event) if !event.is_a?(LogStash::Event) event = LogStash::Event.new(event) end FIELD_RENAMING.each do |old_name, new_name| if event.fields.key?(old_name) event.fields[new_name] = event.fields.delete(old_name) end end event[TYPE_STR] ||= :'rails-event' self.logger << NEWLINE_STR % event.to_json event end
But this doesn't wire to all of the events that the gem subscribes to.
Any other options?
Thank you, Yarden
@shadabahmed any comments/feedback here?
Fixed in #124
Hello, First, this gem is awesome! we're using it in production for a long time :)
I'm looking for a way to rename fields (avoid doing it in logstash, getting faster event flow to ES). One way is:
But this doesn't wire to all of the events that the gem subscribes to.
Any other options?
Thank you, Yarden