<?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: Which props go where when indexing json? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447254#M77796</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/210964"&gt;@tom_frotscher&lt;/a&gt; !  I think I understand it better now.  If I use &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; on my UF, then that will override any props on my indexer.  The problem is that my file is JSON format, but it has a non-standard header and footer that I will need to delete via &lt;CODE&gt;SEDCMD&lt;/CODE&gt; before it's JSON "proper".  The UF can't use transforms to clean that up.&lt;/P&gt;

&lt;P&gt;Based on what you said, if I were to use INDEXED_EXTRACTIONS on my UF, it may not work because my data isn't JSON-proper (yet).&lt;/P&gt;

&lt;P&gt;I believe the solution will be then to just do everything on the indexer (no INDEXED_EXTRACTIONS since I have my own line_breaker), then use KV_MODE=JSON on the SH.  Does that solution make sense or am I off base on this?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:26:28 GMT</pubDate>
    <dc:creator>DEAD_BEEF</dc:creator>
    <dc:date>2020-09-30T00:26:28Z</dc:date>
    <item>
      <title>Which props go where when indexing json?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447251#M77793</link>
      <description>&lt;P&gt;I have json log files that I need to pull into my Splunk instance.  They have some trash data at the beginning and end that I plan on removing with &lt;CODE&gt;SEDCMD&lt;/CODE&gt;.  My end goal is to clean up the file using SEDCMD, index properly (line break &amp;amp; timestamp), auto-parse as much as possible.&lt;/P&gt;

&lt;P&gt;The logs are on a system with a UF which send to the indexers.  I'm getting very confused about &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; &amp;amp; &lt;CODE&gt;KV_MODE&lt;/CODE&gt;.  I thought that I would use &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; on the UF &lt;CODE&gt;props.conf&lt;/CODE&gt;, then everything else I need on my indexers, but &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.1/Data/Extractfieldsfromfileswithstructureddata#Forward_data_extracted_from_structured_data_files"&gt;the docs&lt;/A&gt; state that:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;When you forward structured data to an indexer, it is not parsed when it arrives at the indexer, even if you have configured props.conf on that indexer with INDEXED_EXTRACTIONS. Forwarded data skips the following pipelines on the indexer, which precludes any parsing of that data on the indexer...&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This leads me to believe that if I use &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; on the UF, it won't apply any of the indexer props...so do I just use &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; on my indexers instead?  Or does that only apply if I use one of the &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.1/Data/Listofpretrainedsourcetypes"&gt;pretrained sourcetypes&lt;/A&gt;?  Some answers I read said to use &lt;CODE&gt;KV_MODE&lt;/CODE&gt; on the search heads?  I'm pretty lost on this one.&lt;/P&gt;

&lt;P&gt;I have this written up so far:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;inputs.conf ON UF&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://path_to_files]
index = my_json_index
sourcetype = my_custom_sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf ON IDX&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_custom_sourcetype]
disabled = false
INDEXED_EXTRACTIONS = JSON
KV_MODE = none
SHOULD_LINEMERGE = false
TRUNCATE = 0
LINE_BREAKER = (,)\{\"type\":\"\w+\",\"id\":\"\d+\",\"eventTime\":\"
TIME_PREFIX = \{\"type\":\"\w+\",\"id\":\"\d+\",\"eventTime\":\"
TIME_FORMAT = %FT%T.%3Q
TIME_ZONE = UTC
SEDCMD-1_del_header = s/.*\"events\":\[//g
SEDCMD-2_clean_eof = s/\(.*\)\]\}/\1/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 May 2019 02:26:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447251#M77793</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2019-05-05T02:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Which props go where when indexing json?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447252#M77794</link>
      <description>&lt;P&gt;For what you're doing here.... I don't know that I would use INDEXED_EXTRACTIONS, but instead use KV_MODE=json on the search head, and have the line breaker settings on the indexers, but I want to put together a sample of JSON logs wrapped in an array, wrapped in an object to try out and play with before giving an answer. My fear is that INDEXED_EXTRACTIONS uses its own linebreaker, and that may work against you.... but I honestly don't know.&lt;/P&gt;

&lt;P&gt;First some of my favorite references about props settings:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://wiki.splunk.com/Community:HowIndexingWorks" target="_blank"&gt;https://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Look for .conf talks: "How splunkd works" with &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/119"&gt;@amrit&lt;/a&gt; from .conf17 and .conf16&lt;/LI&gt;
&lt;LI&gt;Also you should keep in mind: &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/Wheretofindtheconfigurationfiles" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/Wheretofindtheconfigurationfiles&lt;/A&gt; when talking about Global Context - index time settings, and App/User Context Search time settings (like KV_MODE): &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/Wheretofindtheconfigurationfiles" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/Wheretofindtheconfigurationfiles&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447252#M77794</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2020-09-30T00:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Which props go where when indexing json?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447253#M77795</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;If you want to use INDEXED_EXTRACTIONS = JSON you need to use it in the props on the UF. You do not need any other line breaking settings (in fact i think they will be ignored). But the file you want to read needs to be in the correct json syntax! As far as i remember it is a array of json objects.&lt;/P&gt;

&lt;P&gt;If you want to do the line breaking by hand, you need to do it on the indexers as usual.&lt;/P&gt;

&lt;P&gt;If you set INDEXED_EXTRACTIONS = JSON on the UF, do not set KV_MODE=JSON on the SH. This will extract fields at index time AND at search time, which will give you fields with duplicated values.&lt;/P&gt;

&lt;P&gt;Greetings&lt;/P&gt;

&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447253#M77795</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2020-09-30T00:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Which props go where when indexing json?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447254#M77796</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/210964"&gt;@tom_frotscher&lt;/a&gt; !  I think I understand it better now.  If I use &lt;CODE&gt;INDEXED_EXTRACTIONS&lt;/CODE&gt; on my UF, then that will override any props on my indexer.  The problem is that my file is JSON format, but it has a non-standard header and footer that I will need to delete via &lt;CODE&gt;SEDCMD&lt;/CODE&gt; before it's JSON "proper".  The UF can't use transforms to clean that up.&lt;/P&gt;

&lt;P&gt;Based on what you said, if I were to use INDEXED_EXTRACTIONS on my UF, it may not work because my data isn't JSON-proper (yet).&lt;/P&gt;

&lt;P&gt;I believe the solution will be then to just do everything on the indexer (no INDEXED_EXTRACTIONS since I have my own line_breaker), then use KV_MODE=JSON on the SH.  Does that solution make sense or am I off base on this?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:26:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Which-props-go-where-when-indexing-json/m-p/447254#M77796</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2020-09-30T00:26:28Z</dc:date>
    </item>
  </channel>
</rss>

