<?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 Data PArsing  json in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516162#M87362</link>
    <description>&lt;P&gt;I am trying to parse json data in Splunk&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the example data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "certificates": [
    {
      "NotAfter": "2020-09-06T15:34:22-07:00",
      "NotBefore": "2019-09-07T15:34:22-07:00",
      "allowedOperations": [
        "certificate_show",
        "certificate_der_download"
      ],
     },
    {
      "NotAfter": "2020-10-07T10:51:40-07:00",
      "NotBefore": "2019-10-08T10:51:40-07:00",
      "allowedOperations": [
        "certificates_show"
      ],
    }
	&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want only the data between the tags before "NotAfter" into separate events , and the top part has to be ignored.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried regex101 to identify to identify the breaking patters , it works there but not in Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please guide.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.,&lt;/P&gt;&lt;P&gt;nawaz&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Aug 2020 23:44:33 GMT</pubDate>
    <dc:creator>nawazns5038</dc:creator>
    <dc:date>2020-08-25T23:44:33Z</dc:date>
    <item>
      <title>Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516162#M87362</link>
      <description>&lt;P&gt;I am trying to parse json data in Splunk&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the example data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "certificates": [
    {
      "NotAfter": "2020-09-06T15:34:22-07:00",
      "NotBefore": "2019-09-07T15:34:22-07:00",
      "allowedOperations": [
        "certificate_show",
        "certificate_der_download"
      ],
     },
    {
      "NotAfter": "2020-10-07T10:51:40-07:00",
      "NotBefore": "2019-10-08T10:51:40-07:00",
      "allowedOperations": [
        "certificates_show"
      ],
    }
	&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want only the data between the tags before "NotAfter" into separate events , and the top part has to be ignored.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried regex101 to identify to identify the breaking patters , it works there but not in Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please guide.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.,&lt;/P&gt;&lt;P&gt;nawaz&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2020 23:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516162#M87362</guid>
      <dc:creator>nawazns5038</dc:creator>
      <dc:date>2020-08-25T23:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516231#M87366</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 | fields _raw
| eval _raw="{
	\"certificates\":[
		{
			\"NotAfter\":\"2020-09-06T15:34:22-07:00\",
			\"NotBefore\":\"2019-09-07T15:34:22-07:00\",
			\"allowedOperations\":[
				\"certificate_show\",
				\"certificate_der_download\"
			]
		},
		{
			\"NotAfter\":\"2020-10-07T10:51:40-07:00\",
			\"NotBefore\":\"2019-10-08T10:51:40-07:00\",
			\"allowedOperations\":[
				\"certificates_show\"
			]
		}
	]
}"&lt;/LI-CODE&gt;&lt;P&gt;what's tag?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| spath certificates{} output=certificates
| mvexpand certificates
| spath input=certificates
| table Not* allowed*&lt;/LI-CODE&gt;&lt;P&gt;like this?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 10:50:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516231#M87366</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-26T10:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516324#M87382</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It didn't work . I want two separate events like this., I tried LINE_BREAKER and break only before in props.conf, to parse the data into individual events but still didn't work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I was able to use regex101 and find a regex to break the event and applied the same regex in Splunk but its not taking&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; {
      "NotAfter": "2020-09-06T15:34:22-07:00",
      "NotBefore": "2019-09-07T15:34:22-07:00",
      "allowedOperations": [
        "certificate_show",
        "certificate_der_download"
      ],
 },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
      "NotAfter": "2020-10-07T10:51:40-07:00",
      "NotBefore": "2019-10-08T10:51:40-07:00",
      "allowedOperations": [
        "certificates_show"
      ],
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Thanks&amp;nbsp;&lt;BR /&gt;Nawaz&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 17:11:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516324#M87382</guid>
      <dc:creator>nawazns5038</dc:creator>
      <dc:date>2020-08-26T17:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516337#M87383</link>
      <description>&lt;P&gt;Just take it back to 1 spath&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| spath certificates{} output=certificates
| mvexpand certificates
| table certificates&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Aug 2020 17:54:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516337#M87383</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-08-26T17:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516384#M87393</link>
      <description>&lt;P&gt;Don't confuse the SPL and the setting.&lt;BR /&gt;&lt;BR /&gt;we make the query. not props.conf because you had not said the setting.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Have you tried the query?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;It didn't work&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;please provide the detail. for example,&amp;nbsp; table or _raw&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 20:29:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516384#M87393</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-26T20:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516589#M87436</link>
      <description>&lt;P&gt;yes , the SPL seems fine.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But in reality , each event contains 50 different certificate tags and comes to 4096 lines in each event.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The main drawback is if we do spath and mvexpand the raw events view would be the same and confusing,&amp;nbsp; i.e, every event would have 4096 lines instead of just one certificate.,&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if we do spath and mvexpand on many events where each event has 50 different certificates , it would take a lot of time. and unclear.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's why I was preferring to break the events at props level so that each certificate would go to each event and the raw events view would be easy to work with.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Anyways, thanks for the SPL&amp;nbsp; you deserve points.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 19:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516589#M87436</guid>
      <dc:creator>nawazns5038</dc:creator>
      <dc:date>2020-08-27T19:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516596#M87437</link>
      <description>&lt;P&gt;props.conf&lt;/P&gt;&lt;P&gt;SHOULD_LINEMERGE = false&lt;/P&gt;&lt;P&gt;LINE_BREAKER = (.){\s*\"NotAfter&lt;/P&gt;&lt;P&gt;KV_MODE = json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and SEDCMD-trim = as_you_like&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 20:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516596#M87437</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-27T20:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516607#M87441</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/184221"&gt;@to4kawa&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was stuck at&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;(.) part.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;what does (.) mean in regex , how did you manage to figure it out ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;do we need to always capture something in the LINE_BREAKER before we write the regex.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nawaz.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2020 22:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516607#M87441</guid>
      <dc:creator>nawazns5038</dc:creator>
      <dc:date>2020-08-27T22:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data PArsing  json</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516656#M87446</link>
      <description>&lt;P&gt;LINE_BREAKER needs regex chapture()&lt;/P&gt;&lt;P&gt;. is one character.&lt;/P&gt;&lt;P&gt;at this case, "," or "["&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 08:51:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Data-PArsing-json/m-p/516656#M87446</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-08-28T08:51:32Z</dc:date>
    </item>
  </channel>
</rss>

