Skip to main content
Solved

Parsing UNIX MS Timestamp

  • January 21, 2025
  • 2 replies
  • 36 views

samryanturner
Forum|alt.badge.img+7

Can someone provide a code snippet for parsing unix_ms from the field 'timestamp' in a json log? I'm in a documentation rabbit hole and just need some fresh eyes.

I get 'unsupported timestamp value format float64' but can't see a function to convert.

Best answer by cbryant

This should be what you are looking for: 

mutate { convert => { "timestamp" => "string" } } date { match => [ "timestamp", "UNIX", "UNIXMS" ] on_error => "no_date_match" }

reference:

2 replies

Forum|alt.badge.img+4
  • Bronze 1
  • Answer
  • January 21, 2025

This should be what you are looking for: 

mutate { convert => { "timestamp" => "string" } } date { match => [ "timestamp", "UNIX", "UNIXMS" ] on_error => "no_date_match" }

reference:


samryanturner
Forum|alt.badge.img+7
  • Author
  • Bronze 5
  • January 22, 2025

This should be what you are looking for: 

mutate { convert => { "timestamp" => "string" } } date { match => [ "timestamp", "UNIX", "UNIXMS" ] on_error => "no_date_match" }

reference:


Thank you, worked like a charm.