<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to configure Splunk to use a specific JSON field as the event's timestamp? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462469#M79810</link>
    <description>&lt;P&gt;For the following example JSON message (formated to make it easier to read), how can I configure props.conf to inform Splunk that it should use data.timestamp for its event timestamp?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    "publish_time": 1580824871.446,
    "data": {
        "textPayload": "DEBUG | 2020-02-04T14:01:05,760 | A very long string here...&amp;lt;snip&amp;gt;",
        "logName": "blah0",
        "receiveTimestamp": "2020-02-04T14:01:07.707699223Z",
        "labels": {
            "k8s-pod/version": "blah2",
            "k8s-pod/track": "blah3",
            "k8s-pod/app": "blah4",
            "k8s-pod/pod-template-hash": "blah5"
        },
        "insertId": "blah6",
        "resource": {
            "type": "k8s_container",
            "labels": {
                "project_id": "blah7",
                "pod_name": "blah8",
                "cluster_name": "blah9",
                "location": "blah10",
                "container_name": "blah11",
                "namespace_name": "blah12"
            }
        },
        "severity": "INFO",
        "timestamp": "2020-02-04T14:01:05.760888513Z"
    },
    "attributes": {
        "logging.googleapis.com/timestamp": "2020-02-04T14:01:05.760888513Z"
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Would the following be correct &amp;amp; performant ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;File: props.conf
---snip---
[google:gcp:pubsub:message]
INDEXED_EXTRACTIONS = json
KV_MODE = none
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIMESTAMP_FIELDS = data.timestamp
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%9N%Z
---snip---
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 05 Feb 2020 20:55:36 GMT</pubDate>
    <dc:creator>jchoksi</dc:creator>
    <dc:date>2020-02-05T20:55:36Z</dc:date>
    <item>
      <title>How to configure Splunk to use a specific JSON field as the event's timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462469#M79810</link>
      <description>&lt;P&gt;For the following example JSON message (formated to make it easier to read), how can I configure props.conf to inform Splunk that it should use data.timestamp for its event timestamp?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    "publish_time": 1580824871.446,
    "data": {
        "textPayload": "DEBUG | 2020-02-04T14:01:05,760 | A very long string here...&amp;lt;snip&amp;gt;",
        "logName": "blah0",
        "receiveTimestamp": "2020-02-04T14:01:07.707699223Z",
        "labels": {
            "k8s-pod/version": "blah2",
            "k8s-pod/track": "blah3",
            "k8s-pod/app": "blah4",
            "k8s-pod/pod-template-hash": "blah5"
        },
        "insertId": "blah6",
        "resource": {
            "type": "k8s_container",
            "labels": {
                "project_id": "blah7",
                "pod_name": "blah8",
                "cluster_name": "blah9",
                "location": "blah10",
                "container_name": "blah11",
                "namespace_name": "blah12"
            }
        },
        "severity": "INFO",
        "timestamp": "2020-02-04T14:01:05.760888513Z"
    },
    "attributes": {
        "logging.googleapis.com/timestamp": "2020-02-04T14:01:05.760888513Z"
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Would the following be correct &amp;amp; performant ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;File: props.conf
---snip---
[google:gcp:pubsub:message]
INDEXED_EXTRACTIONS = json
KV_MODE = none
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIMESTAMP_FIELDS = data.timestamp
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%9N%Z
---snip---
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 20:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462469#M79810</guid>
      <dc:creator>jchoksi</dc:creator>
      <dc:date>2020-02-05T20:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Splunk to use a specific JSON field as the event's timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462470#M79811</link>
      <description>&lt;P&gt;Yes configuration you posted works. Also please set KV_MODE = none and AUTO_KV_JSON = false for this source/sourcetype on search head(s) to avoid multi values in fields.&lt;/P&gt;

&lt;P&gt;File: props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[google:gcp:pubsub:message]
KV_MODE = none
AUTO_KV_JSON = false
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462470#M79811</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-09-30T04:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Splunk to use a specific JSON field as the event's timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462471#M79812</link>
      <description>&lt;P&gt;Thanks for your response.&lt;/P&gt;

&lt;P&gt;I tried using the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;File: props.conf
---snip---
[google:gcp:pubsub:message]
INDEXED_EXTRACTIONS = json
KV_MODE = none
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
AUTO_KV_JSON = false
TIMESTAMP_FIELDS = data.timestamp
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%9N%Z
---snip---
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and found that Splunk's _time field was not being set to the value of the data.timestamp field.&lt;/P&gt;

&lt;P&gt;Maybe Splunk doesn't support nested JSON fields in TIMESTAMP_FIELDS ?&lt;/P&gt;

&lt;P&gt;Currently, I've configured the props.conf file to use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[google:gcp:pubsub:message]
INDEXED_EXTRACTIONS = json
KV_MODE = none
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIME_PREFIX = \"timestamp\": \"
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%9N%Z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which correctly sets Splunk's _time field to the value of data.timestamp&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 10:45:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462471#M79812</guid>
      <dc:creator>jchoksi</dc:creator>
      <dc:date>2020-02-06T10:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure Splunk to use a specific JSON field as the event's timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462472#M79813</link>
      <description>&lt;P&gt;Splunk does support nested json parsing.Please remove attribute TIME_FORMAT from your configurations and try. I am able to parse above json with below configurations.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [google:gcp:pubsub:message]
 INDEXED_EXTRACTIONS = json
 KV_MODE = none
 NO_BINARY_CHECK = true
 SHOULD_LINEMERGE = false
 AUTO_KV_JSON = false
 TIMESTAMP_FIELDS = data.timestamp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 05:41:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-Splunk-to-use-a-specific-JSON-field-as-the/m-p/462472#M79813</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-02-07T05:41:13Z</dc:date>
    </item>
  </channel>
</rss>

