<?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: Extracting fields from JSON file format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165335#M33552</link>
    <description>&lt;P&gt;Your linebreaker doesn't have a capture, which may be the problem. I would set the linebreaker to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;([\r\n]){
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that that is the start of the line, not the end of it.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2014 15:04:15 GMT</pubDate>
    <dc:creator>dshpritz</dc:creator>
    <dc:date>2014-02-26T15:04:15Z</dc:date>
    <item>
      <title>Extracting fields from JSON file format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165330#M33547</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I want to extract the fields from JSON File format and after extrating the fileds. I want to remove one of the value of a particular key, such as : &lt;/P&gt;

&lt;P&gt;My input data : &lt;/P&gt;

&lt;P&gt;{"TID":"111222","EID":"44567","XXX":"00000x&amp;lt;?xml?&amp;gt;aasewl85765"}&lt;/P&gt;

&lt;P&gt;Now, I want to remove the "XXX":"00000x&amp;lt;?xml?&amp;gt;aasewl85765"   .. This should not be indexed other parts should be indexed like {"TID":"111222","EID":"44567" }&lt;/P&gt;

&lt;P&gt;In my Splunk only two fields should come "TID" and "EID".&lt;/P&gt;

&lt;P&gt;Please suggest the best possible way !!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 19:19:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165330#M33547</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2014-02-25T19:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from JSON file format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165331#M33548</link>
      <description>&lt;P&gt;Your order is messed up. First you want to filter out the data (prior to indexing) and then (on search) you extract the fields.&lt;/P&gt;

&lt;P&gt;To filter, in your props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
SEDCMD-removefields = s/{"TID":"\d+","EID":"\d+"(.*)/}/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To extract the fields, you might be able to use Splunk's automagical field extraction. In the same props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
KV_MODE = json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, all together:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
KV_MODE = json
SEDCMD-removefields = s/{"TID":"\d+","EID":"\d+"(.*)/}/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will need to be done on your search heads and indexers.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 21:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165331#M33548</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2014-02-25T21:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from JSON file format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165332#M33549</link>
      <description>&lt;P&gt;I want to have a separate events for each line of JSON file. I am getting all the lines merged with a single events. Please let me know how can I separate the events: &lt;/P&gt;

&lt;P&gt;My Props.conf is :&lt;/P&gt;

&lt;P&gt;[json]&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
LINE_BREAKER = "}$"&lt;BR /&gt;
NO_BINARY_CHECK = 1&lt;BR /&gt;
TRUNCATE = 0&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;/P&gt;

&lt;P&gt;Please help&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:58:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165332#M33549</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2020-09-28T15:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from JSON file format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165333#M33550</link>
      <description>&lt;P&gt;Have you tried without setting a LINE_BREAKER? When I've indexed JSON, it has worked well out of the box as long as the file has the format&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{...}
{...}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i.e. each line is a separate JSON object (which it looks liek you have)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 11:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165333#M33550</guid>
      <dc:creator>laserval</dc:creator>
      <dc:date>2014-02-26T11:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from JSON file format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165334#M33551</link>
      <description>&lt;P&gt;I want to remove one of the field and its value from the file to be indexed. Please help me&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Abhay&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 13:57:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165334#M33551</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2014-02-26T13:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from JSON file format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165335#M33552</link>
      <description>&lt;P&gt;Your linebreaker doesn't have a capture, which may be the problem. I would set the linebreaker to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;([\r\n]){
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that that is the start of the line, not the end of it.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 15:04:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165335#M33552</guid>
      <dc:creator>dshpritz</dc:creator>
      <dc:date>2014-02-26T15:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting fields from JSON file format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165336#M33553</link>
      <description>&lt;P&gt;"Note that that is the start of the line, not the end of it." This clue helped me to get a solution for my problem.&lt;/P&gt;

&lt;P&gt;Thanks a lot !!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2014 09:01:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-fields-from-JSON-file-format/m-p/165336#M33553</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2014-02-27T09:01:06Z</dc:date>
    </item>
  </channel>
</rss>

