<?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 mstats - spaces in metric names in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412426#M50348</link>
    <description>&lt;P&gt;Is there a way to use the improved mstats syntax introduced in 7.1 (changes described &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Mstats#Deprecated_syntax"&gt;here&lt;/A&gt;) with metrics that have spaces in their names? I'm getting an error "Term based search is not supported" when I try.&lt;/P&gt;

&lt;P&gt;I'm trying out the new Splunk Add-on for Microsoft Windows version, which includes the transforms necessary for storing the permon data in metrics indexes. It works great, except for the cases where the perfmon counter name has spaces in it.&lt;/P&gt;

&lt;P&gt;For example, this search works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats avg("Threads") where index=my_metric_index span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this one produces the error mentioned above:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats avg("% Processor Time") where index=my_metric_index span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can get the result I need using the deprecated syntax like this, but there's a reason why it's deprecated:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats avg(_value) where index=my_metric_index metric_name="% Processor Time" span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any good way to resolve this? Currently the only thing that comes to mind is removing or replacing the spaces using SEDCMD, but that doesn't seem very optimal.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 13:57:00 GMT</pubDate>
    <dc:creator>janispelss</dc:creator>
    <dc:date>2018-06-28T13:57:00Z</dc:date>
    <item>
      <title>mstats - spaces in metric names</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412426#M50348</link>
      <description>&lt;P&gt;Is there a way to use the improved mstats syntax introduced in 7.1 (changes described &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Mstats#Deprecated_syntax"&gt;here&lt;/A&gt;) with metrics that have spaces in their names? I'm getting an error "Term based search is not supported" when I try.&lt;/P&gt;

&lt;P&gt;I'm trying out the new Splunk Add-on for Microsoft Windows version, which includes the transforms necessary for storing the permon data in metrics indexes. It works great, except for the cases where the perfmon counter name has spaces in it.&lt;/P&gt;

&lt;P&gt;For example, this search works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats avg("Threads") where index=my_metric_index span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this one produces the error mentioned above:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats avg("% Processor Time") where index=my_metric_index span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can get the result I need using the deprecated syntax like this, but there's a reason why it's deprecated:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats avg(_value) where index=my_metric_index metric_name="% Processor Time" span=1m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any good way to resolve this? Currently the only thing that comes to mind is removing or replacing the spaces using SEDCMD, but that doesn't seem very optimal.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 13:57:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412426#M50348</guid>
      <dc:creator>janispelss</dc:creator>
      <dc:date>2018-06-28T13:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: mstats - spaces in metric names</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412427#M50349</link>
      <description>&lt;P&gt;try to put the field name between single tick.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | mstats avg('% Processor Time')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jun 2018 16:34:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412427#M50349</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2018-06-28T16:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: mstats - spaces in metric names</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412428#M50350</link>
      <description>&lt;P&gt;Unfortunately, this doesn't work for me. Splunk seems to think that the first space signals the end of the avg expression - the error I get is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Error in 'mstats' command: Invalid token: avg('%
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jun 2018 19:00:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412428#M50350</guid>
      <dc:creator>janispelss</dc:creator>
      <dc:date>2018-06-28T19:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: mstats - spaces in metric names</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412429#M50351</link>
      <description>&lt;P&gt;Since I wasn't able to find another way, I went with the SEDCMD replacement approach.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-perfmons = s/(?&amp;lt;!\d\d) /_/g
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This SEDCMD only replaces spaces that are after 2 digits, to avoid replacing spaces in the timestamp (seemed to interfere with correct timestamp recognition).&lt;/P&gt;

&lt;P&gt;Still not sure that this is the best approach, but since the regex is simple enough, I hope it will be ok for the data amounts I'm getting. At least until there's a better solution.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 06:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412429#M50351</guid>
      <dc:creator>janispelss</dc:creator>
      <dc:date>2018-07-02T06:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: mstats - spaces in metric names</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412430#M50352</link>
      <description>&lt;P&gt;I see the exact same behavior. Anyone have any pointers? Or a better workaround?,I see the exact same behavior. Does anyone have any pointers?&lt;/P&gt;</description>
      <pubDate>Sat, 25 Aug 2018 17:45:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/mstats-spaces-in-metric-names/m-p/412430#M50352</guid>
      <dc:creator>riptivoli</dc:creator>
      <dc:date>2018-08-25T17:45:27Z</dc:date>
    </item>
  </channel>
</rss>

