<?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: Appending/Adding count of results in the column header in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355322#M105149</link>
    <description>&lt;P&gt;I have updated, it should have been &lt;CODE&gt;values(user)&lt;/CODE&gt; and not &lt;CODE&gt;last(user)&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2017 02:11:03 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-08-09T02:11:03Z</dc:date>
    <item>
      <title>Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355313#M105140</link>
      <description>&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/3330iCE396DC9C9B500A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have a search - &lt;CODE&gt;index=ABC sourcetype=XYZ | stats values(user), dc(user) by region | transpose header_field=region | fields – column&lt;/CODE&gt; which produces the following result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Region1      Region2          Region3
ABC             XYZ           MNO
PQR             STU           BCD
MKL     
3              2                2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want the count of distinct users to be appended to the column name in the table. Final result should look like the table below. Is this possible in Splunk? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Region1(3)  Region2(2)  Region3(2)
ABC        XYZ         MNO
PQR        STU         BCD
MKL     
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Added a picture of the table to make it clear&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 18:22:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355313#M105140</guid>
      <dc:creator>pushpender07</dc:creator>
      <dc:date>2017-08-08T18:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355314#M105141</link>
      <description>&lt;P&gt;Try this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ABC sourcetype=XYZ 
| stats values(user) as user, dc(user) as usercount by region 
| eval region = region." (".usercount.")"
| fields - usercount
| transpose header_field=region 
| fields – column
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Aug 2017 18:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355314#M105141</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-08T18:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355315#M105142</link>
      <description>&lt;P&gt;@pushpender07, try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ABC sourcetype=XYZ 
| stats values(user) as user dc(user) as dc_user by region 
| eval region=region."(".dc_user.")"
| transpose header_field=region 
| search column=user
| fields – column
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Aug 2017 18:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355315#M105142</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-08T18:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355316#M105143</link>
      <description>&lt;P&gt;@DalJeanis...You beat me to it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 18:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355316#M105143</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-08T18:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355317#M105144</link>
      <description>&lt;P&gt;Perfect, thanks it works&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 18:48:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355317#M105144</guid>
      <dc:creator>pushpender07</dc:creator>
      <dc:date>2017-08-08T18:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355318#M105145</link>
      <description>&lt;P&gt;this one does not work, it just displays one row with user text in it. Response from @DalJeanis works perfectly&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 18:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355318#M105145</guid>
      <dc:creator>pushpender07</dc:creator>
      <dc:date>2017-08-08T18:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355319#M105146</link>
      <description>&lt;P&gt;I was snoozing but we all 3 commented before @someshoni2!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 19:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355319#M105146</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-08T19:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355320#M105147</link>
      <description>&lt;P&gt;@woodcock - you must have sneezed while typing @somesoni2.&lt;/P&gt;

&lt;P&gt;... and it took all my self-control not to type "woodstock"...&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 19:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355320#M105147</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-08T19:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355321#M105148</link>
      <description>&lt;P&gt;I answer to everything.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 19:18:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355321#M105148</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-08T19:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355322#M105149</link>
      <description>&lt;P&gt;I have updated, it should have been &lt;CODE&gt;values(user)&lt;/CODE&gt; and not &lt;CODE&gt;last(user)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 02:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355322#M105149</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-09T02:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355323#M105150</link>
      <description>&lt;P&gt;still does not work, what is the use of search column = user? It shows the same response with one row and "user" as text in it&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 16:23:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355323#M105150</guid>
      <dc:creator>pushpender07</dc:creator>
      <dc:date>2017-08-09T16:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Appending/Adding count of results in the column header</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355324#M105151</link>
      <description>&lt;P&gt;&lt;CODE&gt;| search column=user&lt;/CODE&gt; gets rid of column dc_user (count of distinct users) after transpose, since count is already appended to table header region. You can remove pipes 4, 5 and 6 and then put them back in the query one by one to understand what they are doing.&lt;/P&gt;

&lt;P&gt;If results are not the way you expect, maybe I missed something you want. As far as there is another answer solving your problem you should be good!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 01:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Appending-Adding-count-of-results-in-the-column-header/m-p/355324#M105151</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-10T01:36:49Z</dc:date>
    </item>
  </channel>
</rss>

