<?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 Re: Unable to set indexed time value from JSON file to _time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459917#M93934</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt;: The TIME_FORMAT change did not make any difference, as i tried earlier. I am getting the indexed data as expected but event time i.e., _time needs to be the value of requested_on&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:56:18 GMT</pubDate>
    <dc:creator>shahid285</dc:creator>
    <dc:date>2020-09-29T21:56:18Z</dc:date>
    <item>
      <title>Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459908#M93925</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;
I am finding it difficult trying to set the event time(_time) to be taken from the indexed JSON format file.&lt;/P&gt;

&lt;P&gt;i have done the configurations as below &lt;/P&gt;

&lt;P&gt;in props.conf&lt;BR /&gt;
[aci-inventory]&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE = false&lt;BR /&gt;
BREAK_ONLY_BEFORE = ({|[\s+{)&lt;BR /&gt;
MUST_BREAK_AFTER = (}|}\s+])&lt;BR /&gt;
SEDCMD-remove_header = s/({\s+.+?[)//g&lt;BR /&gt;
SEDCMD-remove_trailing_commas = s/},/}/g&lt;BR /&gt;
SEDCMD-remove_footer = s/]\s+}//g&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S&lt;BR /&gt;
TIMESTAMP_FIELDS = requested_on&lt;BR /&gt;
TRANSFORMS-datetime = aci_timestamp&lt;/P&gt;

&lt;P&gt;in transforms.conf&lt;BR /&gt;
[aci_timestamp]&lt;BR /&gt;
SOURCE_KEY = requested_on&lt;BR /&gt;
DEST_KEY = _time&lt;/P&gt;

&lt;P&gt;example JSON file i used is as below&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
     "IPRequestLog": [&lt;BR /&gt;
         {&lt;BR /&gt;
             "access_key": "test",&lt;BR /&gt;
             "id": "0ac03844-a374-4237-9172-a7af9122bed2",&lt;BR /&gt;
             "ip_address": "192.168.1.245",&lt;BR /&gt;
             "requested_on": "2015-07-28 06:47:48",&lt;BR /&gt;
             "source_ip": "49.248.183.29"&lt;BR /&gt;
         },&lt;BR /&gt;
         {&lt;BR /&gt;
             "access_key": "test",&lt;BR /&gt;
             "id": "0ac03844-a374-4237-9172-e33f206474ff",&lt;BR /&gt;
             "ip_address": "192.168.1.245",&lt;BR /&gt;
             "requested_on": "2015-07-28 06:47:54",&lt;BR /&gt;
             "source_ip": "49.248.183.29"&lt;BR /&gt;
         },&lt;BR /&gt;
         {&lt;BR /&gt;
             "access_key": "test",&lt;BR /&gt;
             "id": "0ac03844-a374-4237-9172-5c256d8d502e",&lt;BR /&gt;
             "ip_address": "192.168.1.245",&lt;BR /&gt;
             "requested_on": "2015-07-28 06:47:51",&lt;BR /&gt;
             "source_ip": "49.248.183.29"&lt;BR /&gt;
         }&lt;BR /&gt;
     ]&lt;BR /&gt;
 }&lt;/P&gt;

&lt;P&gt;Also, please let me know if we really need to set the following keys in transforms.conf. If so what it would be as per the above input file.&lt;BR /&gt;
REGEX = &lt;BR /&gt;
FORMAT =&lt;/P&gt;

&lt;P&gt;I have checked the sample with csv been posted here , using which i came to this conclusion and which is not working for me. &lt;BR /&gt;
Requesting help at the earliest.&lt;BR /&gt;
Thanks&lt;BR /&gt;
Mohammed Shahid Nawaz&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459908#M93925</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2020-09-29T21:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459909#M93926</link>
      <description>&lt;P&gt;without testing,&lt;BR /&gt;
in TIME_FORMAT try to get rid of the &lt;CODE&gt;T&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TIME_FORMAT = %Y-%m-%d %H:%M:%S&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459909#M93926</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-09-29T21:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459910#M93927</link>
      <description>&lt;P&gt;step 1 try only on props &lt;/P&gt;

&lt;P&gt;TIME_FORMAT = %Y-%m-%d %H:%M &lt;BR /&gt;
TIME_PREFIX = \"requested_on\":\s&lt;/P&gt;

&lt;P&gt;just check exact bracket &amp;amp; quotes etc&lt;/P&gt;

&lt;P&gt;play on props -- should give you &lt;BR /&gt;
You dont need transform for this &lt;/P&gt;

&lt;P&gt;also take this out -  TIMESTAMP_FIELDS = requested_on&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459910#M93927</guid>
      <dc:creator>anilsharmahk</dc:creator>
      <dc:date>2020-09-29T21:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459911#M93928</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt;: The TIME_FORMAT change did not make any difference, as i tried earlier. I am getting the indexed data as expected but event time i.e., _time needs to be the value of requested_on&lt;/P&gt;

&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/119947"&gt;@anilsharmahk&lt;/a&gt; : I tried your approach and now not even the data is getting indexed, where earlier i was getting indexed data.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:56:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459911#M93928</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2020-09-29T21:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459912#M93929</link>
      <description>&lt;P&gt;is it &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt;  .. why data indexing stoped. you r prop is messed up you cant have&lt;BR /&gt;&lt;BR /&gt;
"INDEXED_EXTRACTIONS = json&lt;BR /&gt;
KV_MODE = json"&lt;BR /&gt;
eithe one..&lt;BR /&gt;
i thought you need just help on time format and Time_prefix ..&lt;BR /&gt;
please see prop.conf documentation for jason file &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:55:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459912#M93929</guid>
      <dc:creator>anilsharmahk</dc:creator>
      <dc:date>2020-09-29T21:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459913#M93930</link>
      <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/168959/parsing-json-data-structures.html"&gt;https://answers.splunk.com/answers/168959/parsing-json-data-structures.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 16:05:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459913#M93930</guid>
      <dc:creator>anilsharmahk</dc:creator>
      <dc:date>2018-11-07T16:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459914#M93931</link>
      <description>&lt;P&gt;[aci-inventory]&lt;BR /&gt;
INDEXED_EXTRACTIONS = &lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE = false&lt;BR /&gt;
BREAK_ONLY_BEFORE = ({|[\s+{)&lt;BR /&gt;
MUST_BREAK_AFTER = (}|}\s+])&lt;BR /&gt;
SEDCMD-remove_header = s/({\s+.+?[)//g&lt;BR /&gt;
SEDCMD-remove_trailing_commas = s/},/}/g&lt;BR /&gt;
SEDCMD-remove_footer = s/]\s+}//g&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S&lt;BR /&gt;
TIME_PREFIX = \"requested_on\":\s**&lt;BR /&gt;
TRANSFORMS-datetime = aci_timestamp&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:55:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459914#M93931</guid>
      <dc:creator>anilsharmahk</dc:creator>
      <dc:date>2020-09-29T21:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459915#M93932</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/119947"&gt;@anilsharmahk&lt;/a&gt;  even if i have both or remove either of KV_MODE or INDEXED_EXTRACTIONS the result is same as i am presently getting.&lt;BR /&gt;
I checked out the documentation part and was clueless as to why the index logic is behaving so different for JSON and at the same time working for CSV.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Mohammed Shahid Nawaz&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:56:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459915#M93932</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2020-09-29T21:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459916#M93933</link>
      <description>&lt;P&gt;ok lets do this mate .. post the jason and prop... &lt;BR /&gt;
use only prop  you dont need transform.&lt;BR /&gt;
i can re code you full prop for you .. is your splunk on window or linux ? on cluster and what version ? are you putting this prop on forwader ?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 17:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459916#M93933</guid>
      <dc:creator>anilsharmahk</dc:creator>
      <dc:date>2018-11-07T17:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459917#M93934</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt;: The TIME_FORMAT change did not make any difference, as i tried earlier. I am getting the indexed data as expected but event time i.e., _time needs to be the value of requested_on&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:56:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459917#M93934</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2020-09-29T21:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459918#M93935</link>
      <description>&lt;P&gt;alright,&lt;BR /&gt;
the JSON i am trying to use is as follows,&lt;BR /&gt;
{&lt;BR /&gt;
   "imdata": [&lt;BR /&gt;
        {&lt;BR /&gt;
            "cause":"resolution-failed",&lt;BR /&gt;
            "childAction":"",&lt;BR /&gt;
            "code":"F0955",&lt;BR /&gt;
            "count":"1",&lt;BR /&gt;
            "descr":"The object refers to an object that was not found.",&lt;BR /&gt;
            "dn":"fltcode-F0955",&lt;BR /&gt;
            "domain":"infra",&lt;BR /&gt;
            "nonAcked":"1",&lt;BR /&gt;
            "nonDelegated":"1",&lt;BR /&gt;
            "nonDelegatedAndNonAcked":"1",&lt;BR /&gt;
            "rule":"fv-rs-bd-resolve-fail",&lt;BR /&gt;
            "severity":"warning",&lt;BR /&gt;
            "status":"",&lt;BR /&gt;
            "subject":"relation-resolution",&lt;BR /&gt;
            "requested_on": "2015-07-12 06:47:51",&lt;BR /&gt;
            "type":"config"&lt;BR /&gt;
        },&lt;BR /&gt;
        { &lt;BR /&gt;
          "cause":"protocol-ntp-provisioning-failed",&lt;BR /&gt;
          "childAction":"",&lt;BR /&gt;
          "code":"F1699",&lt;BR /&gt;
          "count":"1",&lt;BR /&gt;
          "descr":"This fault occurs when a ntp configuration on a switch has problems",&lt;BR /&gt;
          "dn":"fltcode-F1699",&lt;BR /&gt;
          "domain":"infra",&lt;BR /&gt;
          "nonAcked":"1",&lt;BR /&gt;
          "nonDelegated":"1",&lt;BR /&gt;
          "nonDelegatedAndNonAcked":"1",&lt;BR /&gt;
          "rule":"datetime-ntp-provider-status-ntp-prov-fault",&lt;BR /&gt;
          "severity":"warning",&lt;BR /&gt;
          "status":"",&lt;BR /&gt;
          "subject":"ntp",&lt;BR /&gt;
          "requested_on": "2015-07-12 06:47:51",&lt;BR /&gt;
          "type":"operational"&lt;BR /&gt;
          }&lt;BR /&gt;
    ]&lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;The props.conf is the default one, and it has been untouched except with my newly added source type settings for indexing, which is same as before.&lt;/P&gt;

&lt;P&gt;[aci-inventory]&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE = false&lt;BR /&gt;
BREAK_ONLY_BEFORE = ({|[\s+{)&lt;BR /&gt;
MUST_BREAK_AFTER = (}|}\s+])&lt;BR /&gt;
SEDCMD-remove_header = s/({\s+.+?[)//g&lt;BR /&gt;
SEDCMD-remove_trailing_commas = s/},/}/g&lt;BR /&gt;
SEDCMD-remove_footer = s/]\s+}//g&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S&lt;BR /&gt;
TIMESTAMP_FIELDS = requested_on&lt;/P&gt;

&lt;P&gt;I am doing a basic setup with universal forwarder  and indexer and search head on linux vm (Cent OS 7)&lt;BR /&gt;
the splunk i use is the most recent as i had downloaded just yesterday.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Mohammed Shahid Nawaz&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459918#M93935</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2020-09-29T21:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459919#M93936</link>
      <description>&lt;P&gt;@anilsharmahk  Hi , were you able to debug the issue by any chance?&lt;/P&gt;

&lt;P&gt;thanks&lt;BR /&gt;
Mohammed Shahid Nawaz&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 03:50:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459919#M93936</guid>
      <dc:creator>shahid285</dc:creator>
      <dc:date>2018-11-09T03:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459920#M93937</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/145279"&gt;@shahid285&lt;/a&gt;&lt;BR /&gt;
this how i will try to resolve &lt;BR /&gt;
Step 1: clear all the indexs for this source type [aci-inventory]&lt;BR /&gt;
step 2: remove any bucket copies of index (optional)&lt;BR /&gt;
step 3: create a source type [aci-inventory] on the forwader&lt;BR /&gt;
step 4: open prop.conf  and first get the date right &lt;BR /&gt;
[aci-inventory]&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
description = For indexing JSON comments&lt;BR /&gt;
category = Custom&lt;BR /&gt;
BREAK_ONLY_BEFORE = {(")ca&lt;BR /&gt;
TIME_PREFIX = \"requested_on\":\s&lt;BR /&gt;
TRUNCATE = 0&lt;BR /&gt;
LINE_BREAKER = }(,){(")ca&lt;BR /&gt;
SHOULD_LINEMERGE = true&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%d %H:%M&lt;BR /&gt;
disabled = false&lt;BR /&gt;
SEDCMD-remove = s/{\"imdata\":\s[{/{/g&lt;BR /&gt;
SEDCMD-find_and_replace = s/}]}]}/}]}/1&lt;/P&gt;

&lt;P&gt;Step 5: save props.conf and restart splunk&lt;BR /&gt;
step 6: push data &lt;/P&gt;

&lt;H2&gt;Step 7 : check data on search head&lt;/H2&gt;

&lt;P&gt;just tune the above -- take few runs to get right.&lt;BR /&gt;
thats it  ..&lt;/P&gt;

&lt;P&gt;give it a go bro &lt;/P&gt;

&lt;P&gt;thanks &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:01:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459920#M93937</guid>
      <dc:creator>anilsharmahk</dc:creator>
      <dc:date>2020-09-29T22:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to set indexed time value from JSON file to _time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459921#M93938</link>
      <description>&lt;P&gt;@shahid  &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt; &lt;BR /&gt;
yes i get thats  what  TIME_PREFIX will do &lt;/P&gt;

&lt;P&gt;TIME_PREFIX = \"requested_on\":\s&lt;BR /&gt;
tune this &lt;BR /&gt;
"requested_on": "2015-07-12 06:47:51",&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Unable-to-set-indexed-time-value-from-JSON-file-to-time/m-p/459921#M93938</guid>
      <dc:creator>anilsharmahk</dc:creator>
      <dc:date>2020-09-29T22:01:52Z</dc:date>
    </item>
  </channel>
</rss>

