<?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: Getting Count of specific value in json formatted log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Getting-Count-of-specific-value-in-json-formatted-log/m-p/235171#M188529</link>
    <description>&lt;P&gt;Thank you for the quick answer... please see the clarification I added with the edit.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2015 18:21:04 GMT</pubDate>
    <dc:creator>kahlerb</dc:creator>
    <dc:date>2015-09-24T18:21:04Z</dc:date>
    <item>
      <title>Getting Count of specific value in json formatted log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-Count-of-specific-value-in-json-formatted-log/m-p/235169#M188527</link>
      <description>&lt;P&gt;I have a json splunk log, and I need to get the count of the number of times the "message" field is equal to "Total request time". This same template is used for most all the logs, so the "message" field can have several different values.&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  api:  my-fancy-api &lt;BR /&gt;
  app:  MyApp&lt;BR /&gt;
  category:  RESP_TIME &lt;BR /&gt;
  message:  Total request time &lt;BR /&gt;
  reference_id:  MyID123123&lt;BR /&gt;
  session_id:  1442877284-39497 &lt;BR /&gt;
  time:  09-21-2015 23:14:45.023 +0000 &lt;BR /&gt;
  total_request_time:  0.557 &lt;BR /&gt;
  units:  seconds &lt;BR /&gt;
}&lt;/P&gt;

&lt;P&gt;EDIT:&lt;BR /&gt;
Ultimately I will need to get the count of multiple values for "message" in the same search string. One count for "Total request time" and then another count for "Sub-request time" etc.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-Count-of-specific-value-in-json-formatted-log/m-p/235169#M188527</guid>
      <dc:creator>kahlerb</dc:creator>
      <dc:date>2020-09-29T07:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Count of specific value in json formatted log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-Count-of-specific-value-in-json-formatted-log/m-p/235170#M188528</link>
      <description>&lt;P&gt;Assuming you've setup KV_MODE=json to correctly parse the fields from your json data, try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search message="Total request time" | stats count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Sep 2015 18:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-Count-of-specific-value-in-json-formatted-log/m-p/235170#M188528</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-24T18:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Count of specific value in json formatted log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Getting-Count-of-specific-value-in-json-formatted-log/m-p/235171#M188529</link>
      <description>&lt;P&gt;Thank you for the quick answer... please see the clarification I added with the edit.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2015 18:21:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Getting-Count-of-specific-value-in-json-formatted-log/m-p/235171#M188529</guid>
      <dc:creator>kahlerb</dc:creator>
      <dc:date>2015-09-24T18:21:04Z</dc:date>
    </item>
  </channel>
</rss>

