<?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: How do I remove extra information from field names when parsing JSON? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397301#M70828</link>
    <description>&lt;P&gt;Thank you for the answer but I am looking for a more automated process to do this while the data is getting indexed by changing props file or settings at sourcetype&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 15:32:14 GMT</pubDate>
    <dc:creator>djain</dc:creator>
    <dc:date>2018-10-02T15:32:14Z</dc:date>
    <item>
      <title>How do I remove extra information from field names when parsing JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397299#M70826</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I am trying to ingest JSON data from JSON files. However, instead of just taking the field name, it is also taking header and variable type. See screenshot. I want to remove device.headwaters.watermark.core from the beginning and .long or .string from the end. How can I do that? &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/5845iB057437EA32E82E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:14:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397299#M70826</guid>
      <dc:creator>djain</dc:creator>
      <dc:date>2018-10-02T15:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove extra information from field names when parsing JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397300#M70827</link>
      <description>&lt;P&gt;@djain try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourCurrentSearch&amp;gt;
| rename "device.headwaters.watermark.core.*" as "*"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:20:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397300#M70827</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-10-02T15:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove extra information from field names when parsing JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397301#M70828</link>
      <description>&lt;P&gt;Thank you for the answer but I am looking for a more automated process to do this while the data is getting indexed by changing props file or settings at sourcetype&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397301#M70828</guid>
      <dc:creator>djain</dc:creator>
      <dc:date>2018-10-02T15:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove extra information from field names when parsing JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397302#M70829</link>
      <description>&lt;P&gt;The reason why you are seeing additional name is because of the way your JSON is structured and default parsing will put all node names to make the traversed tree (field name) unique (unless it is a multi-valued field).&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Option 1&lt;/STRONG&gt;: You will have to get rid of  either &lt;CODE&gt;INDEXED_EXTRACTIONS = json&lt;/CODE&gt; OR &lt;CODE&gt;KV_MODE=json&lt;/CODE&gt; (whichever is present) to&lt;CODE&gt;KV_MODE=none&lt;/CODE&gt; without INDEXED_EXTRACTIONS and define your own field extraction. Refer to this answer by @somesoni2 &lt;A href="https://answers.splunk.com/answers/484752/how-to-parse-json-which-makes-up-part-of-the-event.html"&gt;https://answers.splunk.com/answers/484752/how-to-parse-json-which-makes-up-part-of-the-event.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Option 2&lt;/STRONG&gt;: Alternatively, if you are sure there are not events under any of the elements of the tree &lt;CODE&gt;device.headwaters.watermark.core.&lt;/CODE&gt;, you can create a transformation to index only the child JSON element with meaningful data i.e. everything inside &lt;CODE&gt;code&lt;/CODE&gt; node. You should check out Splunk Answers for &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Forwarding/Routeandfilterdatad#Discard_specific_events_and_keep_the_rest"&gt;Routing and Filtering Data&lt;/A&gt; to index only specific part of JSON Payload data. Refer to @woodcock 's answer on similar lines: &lt;A href="https://answers.splunk.com/answers/519236/split-indexing-from-json.html"&gt;https://answers.splunk.com/answers/519236/split-indexing-from-json.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:51:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397302#M70829</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-10-02T16:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove extra information from field names when parsing JSON?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397303#M70830</link>
      <description>&lt;P&gt;hi @djain&lt;/P&gt;

&lt;P&gt;were you able to try out the answer below? If it worked, would you mind approving it?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 20:27:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-remove-extra-information-from-field-names-when-parsing/m-p/397303#M70830</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-10-02T20:27:36Z</dc:date>
    </item>
  </channel>
</rss>

