Calculating day of week using log @timestamp filed instead of the logstash @timestamp


(Ira) #1

Hi,

In my JSON log file I have a field called @timestamp:
{"@timestamp":"2018-10-04T03:07:12.189-04:00","@version":1,"caller_method_name":"beforeBodyWrite","caller_line_number":119,"elapsedTime":"174"}

When I query the index, I see two @timestamp fields- the one added by logstash and the other one is the one coming from the log line (which are not always the same).

I'm trying to calculate the day of week (I'd like the value to be taken from the my log document) by:
mutate {
add_field => {"[weekDayNum]" => "%{+e}"}
}
However, it's being calculated using logstash's @timstamp.

Is there a way I can calculate the day of week using the value in my log?

Thanks.


(Ira) #2

I would appreciate any idea. I can't figure out how can I make my new "weekDayNum" field to retrieve the value from the @timestamp in my log.
Thank you


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.