<?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: Why is Splunk not parsing JSON data correctly with my current sourcetype configuration? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272943#M52414</link>
    <description>&lt;P&gt;How are you bringing in CloudFlare logs?&lt;/P&gt;</description>
    <pubDate>Sun, 16 Oct 2016 23:36:59 GMT</pubDate>
    <dc:creator>cyndiback</dc:creator>
    <dc:date>2016-10-16T23:36:59Z</dc:date>
    <item>
      <title>Why is Splunk not parsing JSON data correctly with my current sourcetype configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272939#M52410</link>
      <description>&lt;P&gt;I am trying to import JSON objects into splunk, my sourcetype is below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ _json_cloudflare ]
CHARSET=UTF-8
INDEXED_EXTRACTIONS=json
KV_MODE=none
NO_BINARY_CHECK=true
SHOULD_LINEMERGE=true
TIMESTAMP_FIELDS=timestamp
TIME_FORMAT=%s%9N
TIME_PREFIX=^
category=Structured
description=JSON cloudflare
disabled=false
pulldown_type=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works flawlessly on the search head, but when I index the data, it goes into Splunk like below,&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1194iF037D57EE9D096C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The sourcetype is on both the universal forwarder &amp;amp; the indexer, any ideas what is wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 10:59:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272939#M52410</guid>
      <dc:creator>rusty009</dc:creator>
      <dc:date>2016-04-04T10:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not parsing JSON data correctly with my current sourcetype configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272940#M52411</link>
      <description>&lt;P&gt;I don't see any issues here. The JSON parser of Splunk Web shows the JSON syntax highlighted, and that means the indexed data is correctly parsed as JSON. &lt;/P&gt;

&lt;P&gt;If you want to see the actual raw data without highlighting, click on the "Show as raw text" hyperlink below the event.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 15:22:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272940#M52411</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-04T15:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not parsing JSON data correctly with my current sourcetype configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272941#M52412</link>
      <description>&lt;P&gt;JSON is a wonderful data structure that Splunk handles beautifully so long as it is 100% JSON and Splunk is properly informed about it.&lt;/P&gt;

&lt;P&gt;So, a few things I would do:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Don't use a _ to prefix your sourcetype names. I know, Splunk does that in the UI but I'm of the opinion _names should only be used for internal-to-Splunk data types, field names, etc.&lt;/LI&gt;
&lt;LI&gt;Remove the spaces inside the stanza declaration: [good_stanza] vs. [ bad_stanza ]&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Place only the relevant bits of the props.conf where they matter.&lt;/P&gt;

&lt;P&gt;props.conf on the universal forwarder and search head:&lt;/P&gt;

&lt;P&gt;[json_sourcetype]&lt;BR /&gt;
INDEXED_EXTRACTIONS = JSON&lt;/P&gt;

&lt;P&gt;props.conf on the indexer(s):&lt;/P&gt;

&lt;P&gt;[json_sourcetype]&lt;BR /&gt;
TIME_PREFIX = timestamp:&lt;BR /&gt;
TIME_FORMAT = %s%3N&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 15&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I removed TIMESTAMP_FIELDS in favour of TIME_PREFIX so that time extraction will work in the event field extractions fail.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:21:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272941#M52412</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2020-09-29T09:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not parsing JSON data correctly with my current sourcetype configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272942#M52413</link>
      <description>&lt;P&gt;Thanks, that worked !&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 15:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272942#M52413</guid>
      <dc:creator>rusty009</dc:creator>
      <dc:date>2016-04-04T15:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk not parsing JSON data correctly with my current sourcetype configuration?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272943#M52414</link>
      <description>&lt;P&gt;How are you bringing in CloudFlare logs?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2016 23:36:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-not-parsing-JSON-data-correctly-with-my-current/m-p/272943#M52414</guid>
      <dc:creator>cyndiback</dc:creator>
      <dc:date>2016-10-16T23:36:59Z</dc:date>
    </item>
  </channel>
</rss>

