<?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: What will the JSON Path for breaking this JSON be while ingesting it in Splunk ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492985#M84270</link>
    <description>&lt;P&gt;&lt;CODE&gt;KV_MODE=JSON&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; EXTRACT-ticket_id = "ticket_id"\s*:\s*"([^"]+)"
 EXTRACT-circuit_id = "circuit_id"\s*:\s*"([^"]+)"
 EXTRACT-customer_id = "customer_id"\s*:\s*"([^"]+)"
 EXTRACT-prob_type = "prob_type"\s*:\s*"([^"]+)"
 EXTRACT-severity = "severity"\s*:\s*"([^"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do you need above?&lt;/P&gt;</description>
    <pubDate>Sat, 01 Feb 2020 03:44:37 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-02-01T03:44:37Z</dc:date>
    <item>
      <title>What will the JSON Path for breaking this JSON be while ingesting it in Splunk ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492981#M84266</link>
      <description>&lt;P&gt;Please note that I want the JSON path expression and want to break this before ingesting it splunk and not to use spath after ingesting&lt;/P&gt;

&lt;P&gt;JSON&lt;BR /&gt;
[&lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"423535", &lt;BR /&gt;
                },&lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"422946", &lt;BR /&gt;
                },&lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"272791", &lt;BR /&gt;
                },&lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"240391", &lt;BR /&gt;
                },&lt;BR /&gt;
]&lt;/P&gt;

&lt;P&gt;Break it as &lt;/P&gt;

&lt;P&gt;Event1:&lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"423535", &lt;BR /&gt;
                }&lt;BR /&gt;
Event 2:&lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"422946", &lt;BR /&gt;
                }&lt;BR /&gt;
Event 3: &lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"272791", &lt;BR /&gt;
                }&lt;BR /&gt;
Event 4:&lt;BR /&gt;
                {&lt;BR /&gt;
                                "ticket_id":"240391", &lt;BR /&gt;
                }&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:51:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492981#M84266</guid>
      <dc:creator>beingkaran</dc:creator>
      <dc:date>2020-09-30T03:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: What will the JSON Path for breaking this JSON be while ingesting it in Splunk ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492982#M84267</link>
      <description>&lt;P&gt;@beingkaran &lt;/P&gt;

&lt;P&gt;Is it actual event you are getting ? if not then can you please share original event with masking confidential information.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 13:37:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492982#M84267</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-01-29T13:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: What will the JSON Path for breaking this JSON be while ingesting it in Splunk ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492983#M84268</link>
      <description>&lt;P&gt;Hi kamlesh this is the gist of it I can disclose more due to customer data but the structure is exact now I want to know the json path that will break them ticket by ticket&lt;/P&gt;

&lt;P&gt;[&lt;BR /&gt;
   {&lt;BR /&gt;
    "ticket_id": "EN_3",&lt;BR /&gt;
    "circuit_id": "ENT3",&lt;BR /&gt;
    "customer_id": "C-1",&lt;BR /&gt;
    "prob_type": "LINKDOWN",&lt;BR /&gt;
    "severity": "Critical"&lt;BR /&gt;
   },&lt;BR /&gt;
   {&lt;BR /&gt;
    "ticket_id": "EN_4",&lt;BR /&gt;
    "circuit_id": "ENT4",&lt;BR /&gt;
    "customer_id": "C-2",&lt;BR /&gt;
    "prob_type": "LINKDOWN",&lt;BR /&gt;
    "severity": "Critical"&lt;BR /&gt;
   }&lt;BR /&gt;
]&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:53:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492983#M84268</guid>
      <dc:creator>beingkaran</dc:creator>
      <dc:date>2020-09-30T03:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: What will the JSON Path for breaking this JSON be while ingesting it in Splunk ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492984#M84269</link>
      <description>&lt;P&gt;Hi  &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/37403"&gt;@beingkaran&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;If you on-board the JSON as-is, you can create search-time extractions to get all the fields, then you won't need to use spath to use them.&lt;/P&gt;

&lt;P&gt;E.G. the following props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ANSWERS_SEARCHTIME]
CHARSET=UTF-8
DATETIME_CONFIG=CURRENT
KV_MODE=JSON
LINE_BREAKER=\}(,?)
NO_BINARY_CHECK=true
SHOULD_LINEMERGE=true
SEDCMD-firstbracket=s/^\[//
SEDCMD-lastbracket=s/\]$//
EXTRACT-ticket_id = "ticket_id"\s*:\s*"([^"]+)"
EXTRACT-circuit_id = "circuit_id"\s*:\s*"([^"]+)"
EXTRACT-customer_id = "customer_id"\s*:\s*"([^"]+)"
EXTRACT-prob_type = "prob_type"\s*:\s*"([^"]+)"
EXTRACT-severity = "severity"\s*:\s*"([^"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will break the event up (assuming no nested brackets) and create search-time fields for all the keys. The props.conf will need to go on both the search head (for search-time extractions) and indexer (for the rest of the props config).&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/279796-2020-02-01-12-28-57-compatwindow.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;An alternative is to use indexed extractions.  You can take advantage of the INDEXED_EXTRACTIONS setting:&lt;/P&gt;

&lt;P&gt;[SPLUNK_ANSWERS]&lt;BR /&gt;
DATETIME_CONFIG = CURRENT&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)&lt;/P&gt;

&lt;P&gt;This results in all the fields being available, with no &lt;EM&gt;spath&lt;/EM&gt; required:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/279795-json.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Note that indexed extractions will take more space on indexers, and will need more CPU to initially on-board. You get the ability to use tstats though, which you can't do with search-time extractions.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492984#M84269</guid>
      <dc:creator>spavin</dc:creator>
      <dc:date>2020-09-30T03:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: What will the JSON Path for breaking this JSON be while ingesting it in Splunk ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492985#M84270</link>
      <description>&lt;P&gt;&lt;CODE&gt;KV_MODE=JSON&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; EXTRACT-ticket_id = "ticket_id"\s*:\s*"([^"]+)"
 EXTRACT-circuit_id = "circuit_id"\s*:\s*"([^"]+)"
 EXTRACT-customer_id = "customer_id"\s*:\s*"([^"]+)"
 EXTRACT-prob_type = "prob_type"\s*:\s*"([^"]+)"
 EXTRACT-severity = "severity"\s*:\s*"([^"]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do you need above?&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2020 03:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492985#M84270</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-01T03:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: What will the JSON Path for breaking this JSON be while ingesting it in Splunk ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492986#M84271</link>
      <description>&lt;P&gt;You can do either or both, depending on how you want the extracted fields to look.&lt;/P&gt;

&lt;P&gt;KV_MODE will give extractions in the form of: {}.fieldname&lt;/P&gt;

&lt;P&gt;EXTRACT- will give extractions in the form of: fieldname&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2020 23:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492986#M84271</guid>
      <dc:creator>spavin</dc:creator>
      <dc:date>2020-02-01T23:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: What will the JSON Path for breaking this JSON be while ingesting it in Splunk ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492987#M84272</link>
      <description>&lt;P&gt;Thanks @spavin &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;JSON_TRIM_BRACES_IN_ARRAY_NAMES = &amp;lt;boolean&amp;gt;
* Whether or not the JSON parser for 'INDEXED_EXTRACTIONS' strips curly
  braces from names of fields that are defined as arrays in JSON events.
* When the JSON parser extracts fields from JSON events, by default, it
  extracts array field names with the curly braces that indicate they
  are arrays ("{}") intact.
* For example, given the following partial JSON event:
    {"datetime":"08-20-2015 10:32:25.267 -0700","log_level":"INFO",...,
      data:{...,"fs_type":"ext4","mount_point":["/disk48","/disk22"],...}}

  Because the "mount_point" field in this event is an array of two
  values ("/disk48" and "/disk22"), the JSON parser sees the field as an
  array, and extracts it as such, including the braces that identify
  it as an array. The resulting field name is "data.mount_point{}").
* Set 'JSON_TRIM_BRACES_IN_ARRAY_NAMES' to "true" if you want the JSON
  parser to strip these curly braces from array field names. (In this
  example, the resulting field is instead "data.mount_point").
* CAUTION: Setting this to "true" makes array field names that are extracted
  at index time through the JSON parser inconsistent with search-time
  extraction of array field names through the 'spath' search command.
* Default: false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this option is useful, too.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2020 03:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-will-the-JSON-Path-for-breaking-this-JSON-be-while/m-p/492987#M84272</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-02T03:55:19Z</dc:date>
    </item>
  </channel>
</rss>

