<?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: metric stats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/metric-stats/m-p/551813#M156594</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is exactly my problem &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232323"&gt;@gerbert&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;I have overly informative metric_name values (containing what should be dimensions inside them, separated by a ".") and would like to extract shorter ones to aggregate upon. And then use mstats.&lt;BR /&gt;&lt;BR /&gt;The trivial difference is that I would extract the new metric and dimension using rex&lt;BR /&gt;&lt;BR /&gt;| rex field=metric_name "dim1\.dim2\.(?&amp;lt;dim3&amp;gt;.+?)\.(?&amp;lt;metric_name_short&amp;gt;\w+)"&lt;BR /&gt;| mstats avg(_value) as val WHERE index=indexz AND metric_name="dim1.dim2.*.*" span=5m by host, metric_name_short , dim3&lt;BR /&gt;&lt;BR /&gt;But this is not allowed. So unless my admin re-indexes our metric index...&lt;/P&gt;</description>
    <pubDate>Mon, 17 May 2021 09:11:44 GMT</pubDate>
    <dc:creator>lorenzoalbanof</dc:creator>
    <dc:date>2021-05-17T09:11:44Z</dc:date>
    <item>
      <title>metric stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/metric-stats/m-p/543198#M153878</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm still very new to splunk and I could use some help. I hope this question is not too general. I would like to use something like "|eval" before "|mstats", where I have to use |mstats because I use metric names. So just using "|stats" is no option.&lt;/P&gt;&lt;P&gt;So I want something like this:&lt;/P&gt;&lt;P&gt;|eval = new_field_name=substr(some_field_name, 3, 2)&lt;BR /&gt;|mstats max(some_metric_field) prestats=f chart=t chart.limit=200 WHERE index=some_index span=1h by new_field_name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I get the error message:&lt;BR /&gt;Error in 'mstats' command: This command must be the first command of a search.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Another problem I have with metric data is that the following search gives me the results I want but is very slow. Any idea why or even better how to fix it?&lt;BR /&gt;&lt;BR /&gt;|mpreview index=some_index&amp;nbsp;&amp;nbsp;&lt;BR /&gt;|search non_metric_field!=0&lt;BR /&gt;|stats count by some_field_name&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 13:20:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/metric-stats/m-p/543198#M153878</guid>
      <dc:creator>gerbert</dc:creator>
      <dc:date>2021-03-10T13:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: metric stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/metric-stats/m-p/551813#M156594</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is exactly my problem &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232323"&gt;@gerbert&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;I have overly informative metric_name values (containing what should be dimensions inside them, separated by a ".") and would like to extract shorter ones to aggregate upon. And then use mstats.&lt;BR /&gt;&lt;BR /&gt;The trivial difference is that I would extract the new metric and dimension using rex&lt;BR /&gt;&lt;BR /&gt;| rex field=metric_name "dim1\.dim2\.(?&amp;lt;dim3&amp;gt;.+?)\.(?&amp;lt;metric_name_short&amp;gt;\w+)"&lt;BR /&gt;| mstats avg(_value) as val WHERE index=indexz AND metric_name="dim1.dim2.*.*" span=5m by host, metric_name_short , dim3&lt;BR /&gt;&lt;BR /&gt;But this is not allowed. So unless my admin re-indexes our metric index...&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 09:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/metric-stats/m-p/551813#M156594</guid>
      <dc:creator>lorenzoalbanof</dc:creator>
      <dc:date>2021-05-17T09:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: metric stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/metric-stats/m-p/552583#M156860</link>
      <description>&lt;P&gt;I'm sorry I can't help you. We ended up reindexing exactly like you suggested in the end of your post.&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 18:24:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/metric-stats/m-p/552583#M156860</guid>
      <dc:creator>gerbert</dc:creator>
      <dc:date>2021-05-21T18:24:25Z</dc:date>
    </item>
  </channel>
</rss>

