<?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: Splunk query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650359#M224828</link>
    <description>&lt;LI-CODE lang="markup"&gt;| rex "cricket\sscore\s*:\s*(?&amp;lt;score&amp;gt;\d+)"
| stats count sum(score) as cricketscore&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 13 Jul 2023 10:34:52 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-07-13T10:34:52Z</dc:date>
    <item>
      <title>Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650358#M224827</link>
      <description>&lt;P&gt;Suppose there are 5 events in raw text in Splunk as below:&lt;/P&gt;&lt;P&gt;"host":"111.123.23.34","level":1,"msg":"cricket score : 10","time":"2023-07-11T17:28:33.265Z"&lt;/P&gt;&lt;P&gt;"host":"111.123.23.34","level":2,"msg":"cricket score : 20","time":"2023-07-11T17:28:33.265Z"&lt;/P&gt;&lt;P&gt;"host":"111.123.23.34","level":3,"msg":"cricket score : 30","time":"2023-07-11T17:28:33.265Z"&lt;/P&gt;&lt;P&gt;"host":"111.123.23.34","level":4,"msg":"cricket score : 40","time":"2023-07-11T17:28:33.265Z"&lt;/P&gt;&lt;P&gt;"host":"111.123.23.34","level"5,"msg":"cricket score : 50","time":"2023-07-11T17:28:33.265Z"&lt;/P&gt;&lt;P&gt;So I need to create a Splunk query to get output as below.&lt;/P&gt;&lt;P&gt;Total Number of events (sum of all events)&lt;BR /&gt;5&lt;/P&gt;&lt;P&gt;Total Score (sum of all cricket score)&lt;BR /&gt;150&lt;/P&gt;&lt;P&gt;Request your help for the same.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 10:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650358#M224827</guid>
      <dc:creator>Awanish1212</dc:creator>
      <dc:date>2023-07-13T10:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650359#M224828</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex "cricket\sscore\s*:\s*(?&amp;lt;score&amp;gt;\d+)"
| stats count sum(score) as cricketscore&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Jul 2023 10:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650359#M224828</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-07-13T10:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650371#M224837</link>
      <description>&lt;P&gt;Alternatively, is the illustrated raw text the full _raw events? &amp;nbsp;They look too much like part of valid JSON objects. &amp;nbsp;If raw events are in JSON, you should have fields host, msg, and so on. &amp;nbsp;If so, using fields instead of _raw would be more efficient, like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval cricket_score = mvindex(split(msg, ": "), 1)
| stats count sum(cricket_score) as total_score&lt;/LI-CODE&gt;&lt;P&gt;If msg field is not available, using extract (aka kv) might also be more efficient than rex, like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| kv pairdelim="," kvdelim=":"
| eval cricket_score = mvindex(split(msg, ": "), 1)
| stats count sum(cricket_score) as total_score&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 11:47:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650371#M224837</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-07-13T11:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650387#M224845</link>
      <description>&lt;P&gt;&lt;STRONG&gt;thanks&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:42:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650387#M224845</guid>
      <dc:creator>Awanish1212</dc:creator>
      <dc:date>2023-07-13T13:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650388#M224846</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:43:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query/m-p/650388#M224846</guid>
      <dc:creator>Awanish1212</dc:creator>
      <dc:date>2023-07-13T13:43:06Z</dc:date>
    </item>
  </channel>
</rss>

