<?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: How to write a search to combine the sum of three metric name into one count? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-combine-the-sum-of-three-metric-name/m-p/657509#M227109</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;, you're a legend!&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 23:49:35 GMT</pubDate>
    <dc:creator>soulmaker</dc:creator>
    <dc:date>2023-09-13T23:49:35Z</dc:date>
    <item>
      <title>How to write a search to combine the sum of three metric name into one count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-combine-the-sum-of-three-metric-name/m-p/657494#M227103</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have three search query below that I want to combine the three metric name sum into one total count. Can someone able to assist how I can write my query?&lt;/P&gt;&lt;P&gt;First Query:&lt;BR /&gt;| mstats sum(vault.token.creation.nonprod) as count where index=vault_metrics span=1h&lt;BR /&gt;| timechart sum(count) as count span=1h&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| eventstats perc90(count) perc50(count)&lt;/P&gt;&lt;P&gt;Second Query:&lt;BR /&gt;| mstats sum(vault.token.creation.dev) as count where index=vault_metrics span=1h&lt;BR /&gt;| timechart sum(count) as count span=1h&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| eventstats perc90(count) perc50(count)&lt;/P&gt;&lt;P&gt;Third Query:&lt;BR /&gt;| mstats sum(vault.token.creation.nonprod_preprod) as count where index=vault_metrics span=1h&lt;BR /&gt;| timechart sum(count) as count span=1h&lt;BR /&gt;| fillnull value=0&lt;BR /&gt;| eventstats perc90(count) perc50(count)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 21:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-combine-the-sum-of-three-metric-name/m-p/657494#M227103</guid>
      <dc:creator>soulmaker</dc:creator>
      <dc:date>2023-09-13T21:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to combine the sum of three metric name into one count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-combine-the-sum-of-three-metric-name/m-p/657506#M227108</link>
      <description>&lt;P&gt;You are collecting from the same index, so just put all 3 counts in the same mstats&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mstats sum(vault.token.creation.nonprod) as count_nonprod
         sum(vault.token.creation.dev) as count_dev
         sum(vault.token.creation.nonprod_preprod) as count_nonprod_preprod
  where index=vault_metrics span=1h
| addtotals
| timechart sum(Total) as Total span=1h
| fillnull value=0
| eventstats perc90(Total) as p90_Total perc50(Total) as p50_Total&lt;/LI-CODE&gt;&lt;P&gt;The addtotals gives you a sume of all the count_* fields into a single new field Total, so then just use that new field total to calculate the percentiles&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 23:39:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-combine-the-sum-of-three-metric-name/m-p/657506#M227108</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-09-13T23:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to combine the sum of three metric name into one count?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-combine-the-sum-of-three-metric-name/m-p/657509#M227109</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;, you're a legend!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 23:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-combine-the-sum-of-three-metric-name/m-p/657509#M227109</guid>
      <dc:creator>soulmaker</dc:creator>
      <dc:date>2023-09-13T23:49:35Z</dc:date>
    </item>
  </channel>
</rss>

