<?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: grouping search results by hostname in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258593#M77453</link>
    <description>&lt;P&gt;Thanks this is working well.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2016 13:47:42 GMT</pubDate>
    <dc:creator>smudge797</dc:creator>
    <dc:date>2016-09-06T13:47:42Z</dc:date>
    <item>
      <title>grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258585#M77445</link>
      <description>&lt;P&gt;We need to group hosts by naming convention in search results so for example hostnames:&lt;BR /&gt;
x80* = env1&lt;BR /&gt;
y20* = prod&lt;BR /&gt;
L* = test&lt;BR /&gt;
etc..&lt;/P&gt;

&lt;P&gt;Also can this be done by | tsats command?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 13:46:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258585#M77445</guid>
      <dc:creator>smudge797</dc:creator>
      <dc:date>2016-09-05T13:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258586#M77446</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval env=case(match(host, "x80*), "env1", match(host, "y20*), "prod", match(host, "L*), "test", 1=1, "UNK") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Sep 2016 13:49:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258586#M77446</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-05T13:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258587#M77447</link>
      <description>&lt;P&gt;Thanks,  looking promising.  seems to struggle with hosts matching names in the middle so like &lt;EM&gt;ny&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 14:48:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258587#M77447</guid>
      <dc:creator>smudge797</dc:creator>
      <dc:date>2016-09-05T14:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258588#M77448</link>
      <description>&lt;P&gt;This will look for hosts that start with &lt;CODE&gt;x80&lt;/CODE&gt; for eg. Not in the middle. Can you share some sample or mocked up hosts to adjust the match pattern&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 14:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258588#M77448</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-05T14:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258589#M77449</link>
      <description>&lt;P&gt;ah the page does not like the wild cards.  common is the ny between the wildcards * ny *&lt;BR /&gt;
RAAG14*&lt;EM&gt;NY&lt;/EM&gt;&lt;EM&gt;1234&lt;BR /&gt;
RABHAG94&lt;/EM&gt;&lt;EM&gt;NY&lt;/EM&gt;&lt;EM&gt;1256 &lt;BR /&gt;
RACAG84&lt;/EM&gt;&lt;EM&gt;NY&lt;/EM&gt;&lt;EM&gt;1277&lt;BR /&gt;
RADAGSS4&lt;/EM&gt;&lt;EM&gt;NY&lt;/EM&gt;&lt;EM&gt;1244 &lt;BR /&gt;
RAEAG14&lt;/EM&gt;&lt;EM&gt;NY&lt;/EM&gt;*9888&lt;/P&gt;

&lt;P&gt;page keeps cutting my post, but i hope it makes sense..&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:49:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258589#M77449</guid>
      <dc:creator>smudge797</dc:creator>
      <dc:date>2020-09-29T10:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258590#M77450</link>
      <description>&lt;P&gt;So all hosts with the characters NY should be considered in the &lt;CODE&gt;prod&lt;/CODE&gt; group?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 16:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258590#M77450</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-05T16:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258591#M77451</link>
      <description>&lt;P&gt;Try something like this (sample tstats command, replace it with your own). The case statement works with regular expression and providing a partial regex will match any position.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* by host | eval Environment=case(match(host,"x80"),"env1",match(host,"y20"),"prod",match(host,"L"),"test","ny","someotherenv",ture(),"OTHERE") | stats sum(count) as count by Environment
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Sep 2016 17:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258591#M77451</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-05T17:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258592#M77452</link>
      <description>&lt;P&gt;Try these&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;match(host, "\*")

match(host, "NY")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Sep 2016 17:01:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258592#M77452</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-05T17:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: grouping search results by hostname</title>
      <link>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258593#M77453</link>
      <description>&lt;P&gt;Thanks this is working well.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 13:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/grouping-search-results-by-hostname/m-p/258593#M77453</guid>
      <dc:creator>smudge797</dc:creator>
      <dc:date>2016-09-06T13:47:42Z</dc:date>
    </item>
  </channel>
</rss>

