<?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 edit my type=host metadata search to exclude a certain index? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237803#M46196</link>
    <description>&lt;P&gt;I am testing this now.  Why is it important to limit the maxsearches?  wont this just return only the number of indexes that match the index= criteria?&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2016 19:18:00 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2016-05-03T19:18:00Z</dc:date>
    <item>
      <title>How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237797#M46190</link>
      <description>&lt;P&gt;I have this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts index=*a OR index=os index!=aruba
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to get all the hosts in all the indexes except the aruba index.&lt;BR /&gt;
The NOT command doesn't work either.  How can I user the index-*a and not include the aruba index?&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 18:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237797#M46190</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2016-05-03T18:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237798#M46191</link>
      <description>&lt;P&gt;I would use tstats for this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=*a OR index=os index!=aruba by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 May 2016 18:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237798#M46191</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-03T18:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237799#M46192</link>
      <description>&lt;P&gt;thanks but I wanted to get the metadata like host, firstTime,  lastTime,  recentTime, totalCount&lt;/P&gt;

&lt;P&gt;I keep all my ORG's in different indexes and was asked to provide states from each index along with metrics on each system&lt;/P&gt;

&lt;P&gt;I don't know if i can get this from tstats?  Or do I use tstats with the metadata search?&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 18:54:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237799#M46192</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2016-05-03T18:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237800#M46193</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/data/indexes 
| rename title as indexname
| search indexname != aruba
| table indexname
| map maxsearches=99 search=" | metadata type=hosts index=\"$indexname$\" | eval index=\"$indexname$\" " 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have also added an index column in case that helps too.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE I have assumed you don't have more than 99 indexes. If so feel free to increase the maxsearches value as it can't be unlimited I'm afraid.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 18:56:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237800#M46193</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-05-03T18:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237801#M46194</link>
      <description>&lt;P&gt;I tried the tstats and it is way slower than the metadata as it is actually doing a count&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 18:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237801#M46194</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2016-05-03T18:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237802#M46195</link>
      <description>&lt;P&gt;I would go with @Javiergn if you're looking for other metadata fields. &lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 19:11:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237802#M46195</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-03T19:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237803#M46196</link>
      <description>&lt;P&gt;I am testing this now.  Why is it important to limit the maxsearches?  wont this just return only the number of indexes that match the index= criteria?&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 19:18:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237803#M46196</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2016-05-03T19:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237804#M46197</link>
      <description>&lt;P&gt;If you don't specify maxsearches then it will default to 10 and map will only run for the first 10 indexes returned.&lt;BR /&gt;
If you have more than 10 indexes then you are going to lose some results.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 19:35:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237804#M46197</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-05-03T19:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237805#M46198</link>
      <description>&lt;P&gt;this was the answer i used.  I change the search just a little but this worked thanks&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2016 14:50:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237805#M46198</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2016-05-04T14:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237806#M46199</link>
      <description>&lt;P&gt;I downvoted this post because this doesn't work&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 17:22:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237806#M46199</guid>
      <dc:creator>moesaidi</dc:creator>
      <dc:date>2017-05-29T17:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my type=host metadata search to exclude a certain index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237807#M46200</link>
      <description>&lt;P&gt;It helps to know the metadata command is essentially a macro around &lt;CODE&gt;tstats&lt;/CODE&gt;. For the clueful, I will translate:&lt;BR /&gt;
The &lt;CODE&gt;firstTime&lt;/CODE&gt; field is &lt;CODE&gt;min(_time)&lt;/CODE&gt;.&lt;BR /&gt;
The "&lt;CODE&gt;astTime&lt;/CODE&gt; field is &lt;CODE&gt;max(_time)&lt;/CODE&gt;.&lt;BR /&gt;
The &lt;CODE&gt;recentTime&lt;/CODE&gt; field is &lt;CODE&gt;max(_indextime)&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Now you can build your own &lt;CODE&gt;tstats&lt;/CODE&gt;-based search and have full control over what is searched (or not).&lt;/P&gt;

&lt;P&gt;I commented about this here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/567047/metadata-showing-wrong-last-indexed-time.html?childToView=567064#answer-567064"&gt;https://answers.splunk.com/answers/567047/metadata-showing-wrong-last-indexed-time.html?childToView=567064#answer-567064&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 12:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-edit-my-type-host-metadata-search-to-exclude-a-certain/m-p/237807#M46200</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-02-11T12:40:18Z</dc:date>
    </item>
  </channel>
</rss>

