<?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 Why am I getting sourcetype errors after trying to configure Splunk to parse json and proper timestamp recognition? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194161#M38658</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying Splunk and try to evaluate it as a tool for managing the logs of our in-house applications. I am uploading a file with thousands of lines like the following ones (2 sample lines):&lt;BR /&gt;
{"time_stamp":"2014-10-06 18:00:00.025956","message_id":2459316836,"rq_id":8036007057,"rs_id":8036007059,"status":"OK","message_type":"OTA_HotelAvailRQ","host":"0.0.0.0","elapsed_time":155,"subsystem":"Player","connectorhost"":localhost","resstatus":"null","requestorid":"TRPS"}&lt;BR /&gt;
{"time_stamp":"2014-10-06 18:00:00.041755","message_id":2459316838,"rq_id":8036007025,"rs_id":8036007010,"status":"OK","message_type":"OTA_HotelAvailRQ","host":"0.0.0.0","elapsed_time":31,"subsystem":"Player","connectorhost""localhost","resstatus":"null","requestorid":"TREP"}&lt;/P&gt;

&lt;P&gt;But after uploading the file I cannot set the proper SourceType. I am choosing _json and setting &lt;BR /&gt;
 - TIME_FORMAT=%Y-%m-%dT%H:%M:%S.%3N %Z&lt;BR /&gt;
 - TIME_FIELD= time_stamp&lt;/P&gt;

&lt;P&gt;But I get the following message: No results found. Please change Sourcetype, adjust Sourcetype settings, or check your source file. &lt;/P&gt;

&lt;P&gt;I will appreciate any help.&lt;/P&gt;

&lt;P&gt;Thanks a lot in advanced.&lt;/P&gt;

&lt;P&gt;Tom.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 18:04:54 GMT</pubDate>
    <dc:creator>tomeumir</dc:creator>
    <dc:date>2020-09-28T18:04:54Z</dc:date>
    <item>
      <title>Why am I getting sourcetype errors after trying to configure Splunk to parse json and proper timestamp recognition?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194161#M38658</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying Splunk and try to evaluate it as a tool for managing the logs of our in-house applications. I am uploading a file with thousands of lines like the following ones (2 sample lines):&lt;BR /&gt;
{"time_stamp":"2014-10-06 18:00:00.025956","message_id":2459316836,"rq_id":8036007057,"rs_id":8036007059,"status":"OK","message_type":"OTA_HotelAvailRQ","host":"0.0.0.0","elapsed_time":155,"subsystem":"Player","connectorhost"":localhost","resstatus":"null","requestorid":"TRPS"}&lt;BR /&gt;
{"time_stamp":"2014-10-06 18:00:00.041755","message_id":2459316838,"rq_id":8036007025,"rs_id":8036007010,"status":"OK","message_type":"OTA_HotelAvailRQ","host":"0.0.0.0","elapsed_time":31,"subsystem":"Player","connectorhost""localhost","resstatus":"null","requestorid":"TREP"}&lt;/P&gt;

&lt;P&gt;But after uploading the file I cannot set the proper SourceType. I am choosing _json and setting &lt;BR /&gt;
 - TIME_FORMAT=%Y-%m-%dT%H:%M:%S.%3N %Z&lt;BR /&gt;
 - TIME_FIELD= time_stamp&lt;/P&gt;

&lt;P&gt;But I get the following message: No results found. Please change Sourcetype, adjust Sourcetype settings, or check your source file. &lt;/P&gt;

&lt;P&gt;I will appreciate any help.&lt;/P&gt;

&lt;P&gt;Thanks a lot in advanced.&lt;/P&gt;

&lt;P&gt;Tom.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194161#M38658</guid>
      <dc:creator>tomeumir</dc:creator>
      <dc:date>2020-09-28T18:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting sourcetype errors after trying to configure Splunk to parse json and proper timestamp recognition?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194162#M38659</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;
It seems that the time stamp field must be the first one. If so, then choosing just _json as source type all fields are parsed well automatically and _time is calculated based on  my time stamp.&lt;BR /&gt;
Rgds,&lt;BR /&gt;
T.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 14:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194162#M38659</guid>
      <dc:creator>tomeumir</dc:creator>
      <dc:date>2014-11-05T14:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting sourcetype errors after trying to configure Splunk to parse json and proper timestamp recognition?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194163#M38660</link>
      <description>&lt;P&gt;First of all, this needs to be correct as you upload the file, so changing anything here will not change what's in Splunk unless you delete it out of Splunk and re-upload your file.&lt;/P&gt;

&lt;P&gt;Second, your &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; differs from your actual input in the following three ways:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;You have a "T" separating the date from the time in the &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;, but it's not there in the data.&lt;/LI&gt;
&lt;LI&gt;You have a "%Z" for the timezone in your &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;, but it's not there in your input.&lt;/LI&gt;
&lt;LI&gt;You have a "%3N" for milliseconds in your &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;, but you appear to have microseconds there, which would mean you want to use "%6N" instead.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Third, you can't use &lt;CODE&gt;TIME_FIELD&lt;/CODE&gt; here since that's used for search-time parsing, not index-time parsing, which is when the sourcetype is assigned. At the point that indexing happens, the JSON parsing has not taken place, and you don't have a &lt;CODE&gt;time_stamp&lt;/CODE&gt; field yet. You need to use the &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; line in your stanza, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = time_stamp":
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Read this for more details: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Configuretimestamprecognition"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Data/Configuretimestamprecognition&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;What happens when you fix those?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 14:58:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194163#M38660</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-11-05T14:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting sourcetype errors after trying to configure Splunk to parse json and proper timestamp recognition?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194164#M38661</link>
      <description>&lt;P&gt;Glad it works!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 15:03:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-am-I-getting-sourcetype-errors-after-trying-to-configure/m-p/194164#M38661</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2014-11-05T15:03:15Z</dc:date>
    </item>
  </channel>
</rss>

