Getting Data In

How to extract timestamp for JSON events with no date/time?

jwalzerpitt
Influencer

I have a flat file that is in JSON format where events have no date/time as follows:

 

 

{"device": "info.gw.xyz.com", "ip": "x.x.x.x", "age": "0", "mac": "Incomplete", "interface": " "}, {"device": "info.gw.xyz.com", "ip": "x.x.x.x", "age": "-", "mac": "0000.0000.0000", "interface": "Vlan673"}

 

 

My props.conf file is as follows:

 

 

[my_arp]
INDEXED_EXTRACTIONS = JSON
TZ=UTC

 

 

Problem is when I search events, they are four hours in the future.

The files are on a sever that has the UF and that has the correct time set so looking through the Splunk docs  (https://docs.splunk.com/Documentation/Splunk/9.0.1/Data/HowSplunkextractstimestamps) I see this:

  • If no events in the source have a date, Splunk software tries to find a date in the source name or file name. The events must have a time, even if they don't have a date.

The files do have a date and time

How do I fix this?

Thx

Labels (1)
Tags (2)
0 Karma

jwalzerpitt
Influencer

Verified with Splunk support that setting the time zone in props in combination with setting time zone preference in GUI is correct

0 Karma

jwalzerpitt
Influencer

So just checked preferences for my account in Splunk Cloud and no default was set so I changed that to GMT/Eastern Time and now when I search the events they have the correct time.

Just making sure this is the fix

0 Karma

somesoni2
Revered Legend

Yes. The data is being logged in GMT/UTC as you specified in props.conf. The _time (or Time column) in search result is translated event time based on current user's timezone (so if you're TZ before UTC, events will show in future). If you want to see the time in the same timezone where they occurred, then what you did is correct (changing your timezone to match data timezone).

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...