Getting Data In

How come I can't override _time with props?

nickdewijer
Explorer

Using an HTTP event collector on a heavy forwarder, I receive JSON that comes in as follows:

{
    "env":  "prod",
    "org":  "xxx",
    "percentile":  "95",
    "proxy":  "xxx",
    "region":  "europe-west1",
    "target":  "ALL",
    "time":  "2019-02-26T10:54:00.000+01:00",
    "totalLatency":  362,
    "targetLatency":  359
}

I want to override the indexing _time field with the timefield from the event. I've tried all forms of the following in Props:

[stansa]

TIMESTAMP_FIELDS = time
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N
TIME_PREFIX = time\":\s*\"
KV_MODE = json

but the _time sticks to indexing time with the Splunk event looking like this:

time
2019-02-26T10:54:00.000+01:00

_time
2019-02-26T10:55:11.000+01:00

Please help me understand why Splunk stubbornly refuses to recognize me passing it a timestamp.

0 Karma
1 Solution

tiagofbmm
Influencer

tiagofbmm
Influencer

Here is the reason why no TIME parsing is done on JSON Endpoints:

https://answers.splunk.com/answers/411892/json-timestamps-not-parsed-via-http-event-collecto.html

nickdewijer
Explorer

That's amazing, never knew. I've switched over to raw, had to play around with the props AND the data coming into the HEC but it's exactly as I want it now.

0 Karma

tiagofbmm
Influencer

Forget about the TIMESTAM_FIELDS.

Keep the following configurations and make sure these are in the first Heavy Forwarder or Indexer through which the data is going

KV_MODE=json
TIME_PREFIX=time\":\s*\"
TIME_FORMAT=%Y-%m-%dT%H:%M:%S.%3N
MAX_TIMESTAMP_LOOKAHEAD=24

0 Karma

nickdewijer
Explorer

I've implemented this exactly, on the Heavy Forwarder that is hosting the HEC. No effect.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...