<?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 How get a total count based on the substring value? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646875#M223886</link>
    <description>&lt;P&gt;Below is the splunk query,&amp;nbsp; (My.Message has many various types of messages but the below one is what I wanted)&lt;BR /&gt;&lt;BR /&gt;index="myIndex" app_name="myappName"&amp;nbsp; My.Message = "*symbolName:*"&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When I run the above query, I get the below results:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0002009&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;myappstatus got Ended, symbolName: GOOGL ElapsedTime: 0.0005339&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0005339&lt;BR /&gt;&lt;BR /&gt;Please help on the following:&amp;nbsp;&lt;BR /&gt;1) How to get the Total count of the query (Visualization) only for My.Message = "*symbolName:*"&amp;nbsp;&lt;BR /&gt;2) How to split the string "myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0002009"&amp;nbsp;&lt;BR /&gt;3) How to create a table for "symbolName", "Total Count", "ElapsedTime"&lt;BR /&gt;&lt;BR /&gt;(for example,&amp;nbsp;symbolName: AAPL,&amp;nbsp;Total Count = 2 and&amp;nbsp;ElapsedTime =&amp;nbsp;0.0007348 (0.0002009 +&amp;nbsp;0.0005339)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2023 23:47:06 GMT</pubDate>
    <dc:creator>Sureshp191</dc:creator>
    <dc:date>2023-06-14T23:47:06Z</dc:date>
    <item>
      <title>How get a total count based on the substring value?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646875#M223886</link>
      <description>&lt;P&gt;Below is the splunk query,&amp;nbsp; (My.Message has many various types of messages but the below one is what I wanted)&lt;BR /&gt;&lt;BR /&gt;index="myIndex" app_name="myappName"&amp;nbsp; My.Message = "*symbolName:*"&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When I run the above query, I get the below results:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0002009&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;myappstatus got Ended, symbolName: GOOGL ElapsedTime: 0.0005339&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0005339&lt;BR /&gt;&lt;BR /&gt;Please help on the following:&amp;nbsp;&lt;BR /&gt;1) How to get the Total count of the query (Visualization) only for My.Message = "*symbolName:*"&amp;nbsp;&lt;BR /&gt;2) How to split the string "myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0002009"&amp;nbsp;&lt;BR /&gt;3) How to create a table for "symbolName", "Total Count", "ElapsedTime"&lt;BR /&gt;&lt;BR /&gt;(for example,&amp;nbsp;symbolName: AAPL,&amp;nbsp;Total Count = 2 and&amp;nbsp;ElapsedTime =&amp;nbsp;0.0007348 (0.0002009 +&amp;nbsp;0.0005339)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 23:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646875#M223886</guid>
      <dc:creator>Sureshp191</dc:creator>
      <dc:date>2023-06-14T23:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: How get a total count based on the substring value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646891#M223892</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257729"&gt;@Sureshp191&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Based on the example events provided, here's some demonstration run anywhere code showing a method to do what you want...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval raw="myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0002009
myappstatus got Ended, symbolName: GOOGL ElapsedTime: 0.0005339
myappstatus got Created, symbolName: AAPL ElapsedTime: 0.0005339"
| eval raw=split(raw, "
")
| mvexpand raw
| rename raw AS _raw
  ``` the above is just creating dummy events to test the following SPL code with ```
| rex "symbolName: (?&amp;lt;symbolName&amp;gt;\w+) ElapsedTime: (?&amp;lt;ElapsedTime&amp;gt;[^\s]+)"
| eventstats count AS "Total Count" list(ElapsedTime) AS listElapsedTime sum(ElapsedTime) AS "Total ElapsedTime" BY symbolName
| table symbolName "Total Count" "Total ElapsedTime"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Hope that helps&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 01:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646891#M223892</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-06-14T01:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How get a total count based on the substring value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646904#M223899</link>
      <description>&lt;P&gt;Thanks, I got the output but symbolName AAPL is duplicated&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_682940b.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25824i196948DFB206E5C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Snag_682940b.png" alt="Snag_682940b.png" /&gt;&lt;/span&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 04:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646904#M223899</guid>
      <dc:creator>Sureshp191</dc:creator>
      <dc:date>2023-06-14T04:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How get a total count based on the substring value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646910#M223904</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257729"&gt;@Sureshp191&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;OK, to dedup&amp;nbsp; results do it this way...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myIndex" app_name="myappName"  My.Message = "*symbolName:*" 
| rex "symbolName: (?&amp;lt;symbolName&amp;gt;\w+) ElapsedTime: (?&amp;lt;ElapsedTime&amp;gt;[^\s]+)"
| stats count AS "Total Count" sum(ElapsedTime) AS "Total ElapsedTime" BY symbolName&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 05:07:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-get-a-total-count-based-on-the-substring-value/m-p/646910#M223904</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2023-06-14T05:07:16Z</dc:date>
    </item>
  </channel>
</rss>

