<?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 Find the count of a specific field value in json array of objects. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-the-count-of-a-specific-field-value-in-json-array-of/m-p/558609#M158696</link>
    <description>&lt;P&gt;Hi i have a json data which i am working on and i used fieldsummary to get data similar to below image.&lt;/P&gt;&lt;P&gt;sample example:&lt;/P&gt;&lt;P&gt;suppose i have my result like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (38).png" style="width: 795px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14976i975A528FEB9DDBAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (38).png" alt="Screenshot (38).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to get count of value "Denver" in the field values from the above image. I tried spath but it's not working.&lt;/P&gt;&lt;P&gt;output&amp;nbsp; should be&amp;nbsp; like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;value        Count

Denver         1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated. thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 17:55:10 GMT</pubDate>
    <dc:creator>nikitha15</dc:creator>
    <dc:date>2021-07-07T17:55:10Z</dc:date>
    <item>
      <title>Find the count of a specific field value in json array of objects.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-count-of-a-specific-field-value-in-json-array-of/m-p/558609#M158696</link>
      <description>&lt;P&gt;Hi i have a json data which i am working on and i used fieldsummary to get data similar to below image.&lt;/P&gt;&lt;P&gt;sample example:&lt;/P&gt;&lt;P&gt;suppose i have my result like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (38).png" style="width: 795px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14976i975A528FEB9DDBAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot (38).png" alt="Screenshot (38).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to get count of value "Denver" in the field values from the above image. I tried spath but it's not working.&lt;/P&gt;&lt;P&gt;output&amp;nbsp; should be&amp;nbsp; like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;value        Count

Denver         1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated. thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 17:55:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-count-of-a-specific-field-value-in-json-array-of/m-p/558609#M158696</guid>
      <dc:creator>nikitha15</dc:creator>
      <dc:date>2021-07-07T17:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: Find the count of a specific field value in json array of objects.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-count-of-a-specific-field-value-in-json-array-of/m-p/558680#M158724</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/69465"&gt;@nikitha15&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try this approach, you have to tune regex matching to your data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval value="[{\"name1\":\"val1\",\"count\":3},{\"name2\":\"val2\",\"count\":1}, {\"name3\":\"val3\",\"count\":2}]" 
| eval json_arrays=split(value,"},") 
| mvexpand json_arrays 
| rex field=json_arrays "\"(?&amp;lt;name&amp;gt;[^\"]+)\":\"(?&amp;lt;value&amp;gt;[^\"]+)\"\,\"count\":(?&amp;lt;count_val&amp;gt;\d+)" 
| table json_arrays name value count_val&lt;/LI-CODE&gt;&lt;P&gt;Tried output,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="venkatasri_0-1625748890304.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14985iD8245C5A7F8C9544/image-size/medium?v=v2&amp;amp;px=400" role="button" title="venkatasri_0-1625748890304.png" alt="venkatasri_0-1625748890304.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;An upvote would be appreciated and Accept solution if this reply helps!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 12:56:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-count-of-a-specific-field-value-in-json-array-of/m-p/558680#M158724</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-07-08T12:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Find the count of a specific field value in json array of objects.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-the-count-of-a-specific-field-value-in-json-array-of/m-p/558805#M158766</link>
      <description>&lt;P&gt;Thanks a ton. This worked.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 07:15:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-the-count-of-a-specific-field-value-in-json-array-of/m-p/558805#M158766</guid>
      <dc:creator>nikitha15</dc:creator>
      <dc:date>2021-07-09T07:15:48Z</dc:date>
    </item>
  </channel>
</rss>

