<?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: Can you help me with my search to extract and stats count a JSON field using Splunk? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409128#M72561</link>
    <description>&lt;P&gt;Basically I want to extract Src, Type and same want to use in my stats count&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2018 22:12:13 GMT</pubDate>
    <dc:creator>harishnpandey</dc:creator>
    <dc:date>2018-10-04T22:12:13Z</dc:date>
    <item>
      <title>Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409126#M72559</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;I want a Splunk query to extract and stats count filed from JSON msg body.&lt;/P&gt;

&lt;P&gt;For e.g:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index=abc org_name="JBL" AND app_name="contract-rules" AND space_name=Production msg="&lt;EM&gt;LoggingService = ContractRule, ContractId&lt;/EM&gt;, Type = *, Status = Success"|stats count as Success by Src,Type&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;app_id:  6a878fd5-540e-4a28-b7ae-970e8a91b74e   
     app_name:   contract-rules 
     org_name:   JBL    
     space_name: Production 
     message_type:   OUT    
     **msg:  2018-10-04 18:27:38.302  INFO [bill-cntct-rules-v0,57a307b46ae1593b,57a307b46ae1593b,true] 18 --- [nio-8080-exec-4] c.u.f.b.c.service.CntctRuleService    : LoggingService = ContractRule, ContractId = H235678, Type = ASC, Src = JBL, Status = Success** 
     origin:     rep    
     source_instance:    2  
     source_type:    APP/PROC/WEB   
     timestamp:  1538677658302837000    
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:30:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409126#M72559</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2020-09-29T21:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409127#M72560</link>
      <description>&lt;P&gt;Can you clarify what you want extracted from the message body? The rex command would likely work well but need to clarify your goal(s). &lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 21:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409127#M72560</guid>
      <dc:creator>jgbricker</dc:creator>
      <dc:date>2018-10-04T21:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409128#M72561</link>
      <description>&lt;P&gt;Basically I want to extract Src, Type and same want to use in my stats count&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 22:12:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409128#M72561</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2018-10-04T22:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409129#M72562</link>
      <description>&lt;P&gt;This assumes that you have msg extracted, if not drop field=msg.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc org_name="JBL" AND app_name="contract-rules" AND space_name=Production msg="LoggingService = ContractRule, ContractId, Type = , Status = Success" |rex field=msg “Type\s+\=\s+(?P&amp;lt;Type&amp;gt;[^\,]+)\,\s+Src\s+\=\s+(?P&amp;lt;Src&amp;gt;[^\,]+)\,” |stats count as Success by Src,Type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Oct 2018 01:22:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409129#M72562</guid>
      <dc:creator>jgbricker</dc:creator>
      <dc:date>2018-10-05T01:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409130#M72563</link>
      <description>&lt;P&gt;Did not work&lt;/P&gt;

&lt;P&gt;Error in 'SearchParser': Missing a search command before '^'. Error at position '228' of search query 'search index=abc  org_name="JBL" c...{snipped} {errorcontext = (?P[^\,]+)\,\s+}'.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 14:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409130#M72563</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2018-10-05T14:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409131#M72564</link>
      <description>&lt;P&gt;hmm seems to be something with the search syntax. Can you add a screenshot?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 15:45:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409131#M72564</guid>
      <dc:creator>jgbricker</dc:creator>
      <dc:date>2018-10-05T15:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409132#M72565</link>
      <description>&lt;P&gt;&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/5874iEB0CE55611BA3940/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Attached snippet . Current SQL allows me to result the count using stats of fields out of msg body.&lt;/P&gt;

&lt;P&gt;Below is my msg body &lt;BR /&gt;
     msg:    2018-10-05 18:01:50.429  INFO [billing-contract-rules-v0,873b26f593081fd6,873b26f593081fd6,true] 19 --- [nio-8080-exec-3] c.u.f.b.c.service.ContractRuleService    : LoggingService = ContractRule, ContractId = MY66610, Type = CAS, Src = BMX, Status = Success  &lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 18:11:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409132#M72565</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2018-10-05T18:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409133#M72566</link>
      <description>&lt;P&gt;Attached snippet &lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 18:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409133#M72566</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2018-10-05T18:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409134#M72567</link>
      <description>&lt;P&gt;so if u put the part of my sample search below without the field=msg just prior to your pupe stats portuon it should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex “Type\s+\=\s+(?P&amp;lt;Type&amp;gt;[^\,]+)\,\s+Src\s+\=\s+(?P&amp;lt;Src&amp;gt;[^\,]+)\,”
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Oct 2018 21:02:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409134#M72567</guid>
      <dc:creator>jgbricker</dc:creator>
      <dc:date>2018-10-05T21:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with my search to extract and stats count a JSON field using Splunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409135#M72568</link>
      <description>&lt;P&gt;any luck? &lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 09:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-with-my-search-to-extract-and-stats-count-a-JSON/m-p/409135#M72568</guid>
      <dc:creator>jgbricker</dc:creator>
      <dc:date>2018-10-09T09:00:14Z</dc:date>
    </item>
  </channel>
</rss>

