<?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 do I edit my search to output unique values per host? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248487#M74174</link>
    <description>&lt;P&gt;I got the expected output. Thanks much jedatt01.&lt;/P&gt;</description>
    <pubDate>Sun, 22 Nov 2015 13:34:40 GMT</pubDate>
    <dc:creator>prakash007</dc:creator>
    <dc:date>2015-11-22T13:34:40Z</dc:date>
    <item>
      <title>How do I edit my search to output unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248485#M74172</link>
      <description>&lt;P&gt;Any help would be much appreciated here..&lt;/P&gt;

&lt;P&gt;Here's my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main host=host1* source=*server.log*  "exception" |  stats count, values(instance) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm getting this output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host    count   values(instance)
host1   1073     ins1
                 ins2
                 ins3
host2   1021     ins2
                 ins3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm looking for output with unique values for each instance, your help would be appreciated:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host    count   values(instance)
host1   1000     ins1
        70       ins2
        3        ins3
host2   1000     ins2
        21       ins3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Nov 2015 06:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248485#M74172</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2015-11-22T06:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to output unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248486#M74173</link>
      <description>&lt;P&gt;The reason you are only getting a single count is because of your by clause. It will only show the total count for each host. To accomplish what you want you need run stats on your data twice.&lt;/P&gt;

&lt;P&gt;Index=main host=host1* source=server.log "exception" | stats count by host instance | stats list(count) list(instance) by host&lt;/P&gt;</description>
      <pubDate>Sun, 22 Nov 2015 12:47:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248486#M74173</guid>
      <dc:creator>jedatt01</dc:creator>
      <dc:date>2015-11-22T12:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to output unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248487#M74174</link>
      <description>&lt;P&gt;I got the expected output. Thanks much jedatt01.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Nov 2015 13:34:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248487#M74174</guid>
      <dc:creator>prakash007</dc:creator>
      <dc:date>2015-11-22T13:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to output unique values per host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248488#M74175</link>
      <description>&lt;P&gt;mcnamara, plz vote up my answer so when people search they know that this answer did indeed work for you. &lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 14:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-output-unique-values-per-host/m-p/248488#M74175</guid>
      <dc:creator>jedatt01</dc:creator>
      <dc:date>2015-11-23T14:40:32Z</dc:date>
    </item>
  </channel>
</rss>

