<?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: Why is my search using &amp;quot;mcollect&amp;quot; command causing the following error: &amp;quot;Error in 'mcollect' command: Must specify a valid metric index&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456073#M128949</link>
    <description>&lt;P&gt;I feel that the output of the results may not be right since the method is different.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time, value, a_dimension, metric_name | mcollect index=test_metric
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;_time value   a_dimension metric_name&lt;/STRONG&gt;&lt;BR /&gt;
2018-09-12 12:16:01.100 1.45    view_point  view.point.metrics&lt;BR /&gt;
2018-09-12 12:19:01.100 0.9         view_point  view.point.metrics&lt;BR /&gt;
2018-09-12 12:21:01.100 3.41    view_point  view.point.metrics&lt;/P&gt;

&lt;P&gt;Field value is a double. If I try to rename value to _value, still does not work.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:14:52 GMT</pubDate>
    <dc:creator>ben_leung</dc:creator>
    <dc:date>2020-09-29T21:14:52Z</dc:date>
    <item>
      <title>Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456070#M128946</link>
      <description>&lt;P&gt;In my query before, I was using the &lt;CODE&gt;outputcsv&lt;/CODE&gt; search command, and then I had a monitoring input stanza to upload it to my metrics index.&lt;/P&gt;

&lt;P&gt;I then took out the &lt;CODE&gt;outputcsv&lt;/CODE&gt; command and started using &lt;CODE&gt;mcollect&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Not sure why, but the metrics index is not valid when it recieved metrics from a different method.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....  | mcollect index=metrics-index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And on my indexes.conf, the settings is configured to be metrics:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[metrics-index]
datatype = metric
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5757i89FAF3E75312F025/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 22:38:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456070#M128946</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2018-09-11T22:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456071#M128947</link>
      <description>&lt;P&gt;This is a distributed search environment with search head clustering.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 01:23:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456071#M128947</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2018-09-12T01:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456072#M128948</link>
      <description>&lt;P&gt;So, here's some triage steps.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;1) Put quotes around your metrics index name and submit again.  If that fixes the problem, then the hyphen is being incorrectly interpreted as a minus sign.  Skip the remainder of the steps.    &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;2A) Create a new, empty metrics index "junkmetrics" with no special characters in the name.&lt;/P&gt;

&lt;P&gt;2B) Try your query with &lt;CODE&gt;mcollect&lt;/CODE&gt; with that new index.  &lt;/P&gt;

&lt;P&gt;If that works, then the problem is either the name with the hyphens, or the prior data in the index. &lt;/P&gt;

&lt;P&gt;2C) Create a junk index with hyphens in the name and try again.  (It's supposed to be allowed as an index name, but none of the examples have hyphens.)&lt;/P&gt;

&lt;P&gt;If that works, then the prior data is the likely culprit.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;3) If that (2A) does not work, then those two items are off the table, and you know it is probably something with your search language itself.  You've already tested the index name, so just report back and let us know, and we'll give you the next tranche of guesses.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 04:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456072#M128948</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-09-12T04:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456073#M128949</link>
      <description>&lt;P&gt;I feel that the output of the results may not be right since the method is different.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table _time, value, a_dimension, metric_name | mcollect index=test_metric
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;_time value   a_dimension metric_name&lt;/STRONG&gt;&lt;BR /&gt;
2018-09-12 12:16:01.100 1.45    view_point  view.point.metrics&lt;BR /&gt;
2018-09-12 12:19:01.100 0.9         view_point  view.point.metrics&lt;BR /&gt;
2018-09-12 12:21:01.100 3.41    view_point  view.point.metrics&lt;/P&gt;

&lt;P&gt;Field value is a double. If I try to rename value to _value, still does not work.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456073#M128949</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2020-09-29T21:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456074#M128950</link>
      <description>&lt;P&gt;Okay so to resolve the issue, setup the metrics index on the search head cluster.&lt;BR /&gt;
Missing the indexes.conf on our search head cluster. Overlooked this because we have indexes defined on our indexers.&lt;BR /&gt;
Also because the previous method of using outputcsv and a monitoring stanza did not require any index definition on search heads.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 06:36:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456074#M128950</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2018-09-20T06:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456075#M128951</link>
      <description>&lt;P&gt;In a distributed splunk environment, the search head also needs to have stub index of the same name and datatype for any of the collect (ie. collect, mcollect, meventcollect).  Note: for metric index, you will need to specify datatype = metric in the relevant index.conf stanza. &lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 16:48:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456075#M128951</guid>
      <dc:creator>splunkIT</dc:creator>
      <dc:date>2018-09-20T16:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456076#M128952</link>
      <description>&lt;P&gt;Right, just couldn't find a doc for version 7.1.2 about that.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 10:17:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456076#M128952</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2018-09-21T10:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search using "mcollect" command causing the following error: "Error in 'mcollect' command: Must specify a valid metric index"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456077#M128953</link>
      <description>&lt;P&gt;index=xyz source=abc |table coloumnone coloumtwo |mcollect index=metric_index split=true coloumtwo &lt;/P&gt;

&lt;P&gt;above is the example hope it helps &lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 12:53:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-using-quot-mcollect-quot-command-causing-the/m-p/456077#M128953</guid>
      <dc:creator>anem</dc:creator>
      <dc:date>2019-11-27T12:53:38Z</dc:date>
    </item>
  </channel>
</rss>

