<?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 display only column(s) that has value greater than 0 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328626#M97820</link>
    <description>&lt;P&gt;Try add this to your base search&lt;/P&gt;

&lt;P&gt;| transpose&lt;BR /&gt;
|  addtotals&lt;BR /&gt;
|  search Total&amp;gt;0&lt;BR /&gt;
|  fields- Total&lt;BR /&gt;
|  transpose header_field=column&lt;BR /&gt;
| fields - column&lt;/P&gt;</description>
    <pubDate>Thu, 12 Apr 2018 12:36:17 GMT</pubDate>
    <dc:creator>HeinzWaescher</dc:creator>
    <dc:date>2018-04-12T12:36:17Z</dc:date>
    <item>
      <title>How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328622#M97816</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I have table looks like this&lt;/P&gt;

&lt;P&gt;Column1,Column2,Column3,....,ColumnX&lt;BR /&gt;
1,2,0,....5&lt;BR /&gt;
1,0,5,....3&lt;BR /&gt;
2,3,0,....0&lt;/P&gt;

&lt;P&gt;Sometimes, depending on the search duration, the result could look like this&lt;/P&gt;

&lt;P&gt;Column1,Column2,Column3,....,ColumnX&lt;BR /&gt;
1,0,0,....3&lt;BR /&gt;
2,0,0,....0&lt;BR /&gt;
3,0,0,....3&lt;/P&gt;

&lt;P&gt;I want to filter the column(s) that has only value "0" inside, so result will only show:&lt;BR /&gt;
Column1,....ColumnX&lt;BR /&gt;
1,....3&lt;BR /&gt;
2,....0&lt;BR /&gt;
3,....3&lt;/P&gt;

&lt;P&gt;Is it possible?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 05:22:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328622#M97816</guid>
      <dc:creator>Cbr1sg</dc:creator>
      <dc:date>2018-04-12T05:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328623#M97817</link>
      <description>&lt;P&gt;why is &lt;CODE&gt;Column 1&lt;/CODE&gt; in the final result? There is no &lt;EM&gt;0&lt;/EM&gt; in the column. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 11:42:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328623#M97817</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-04-12T11:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328624#M97818</link>
      <description>&lt;P&gt;And to be clear - you want to remove columnX for displaying if ALL columnX are zero, but display that column if &lt;EM&gt;any&lt;/EM&gt; value in it is non-zero?&lt;/P&gt;

&lt;P&gt;E.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1, 4, 0, 0
5, 0, 0, 4
2, 1, 0, 9
4, 0, 0, 0
0, 0, 0, 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In that case, all 5 rows display, and columns 1, 2 and 4 are the only ones showing?  is that right?&lt;/P&gt;

&lt;P&gt;And did you &lt;EM&gt;specifically&lt;/EM&gt; want a dot in the column, or how do you want to display it?  Not at all?  like...&lt;BR /&gt;
    1, 4, 0&lt;BR /&gt;
    5, 0, 4&lt;BR /&gt;
    2, 1, 9&lt;BR /&gt;
    4, 0, 0&lt;BR /&gt;
    0, 0, 0&lt;BR /&gt;
(With column headers?)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 11:48:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328624#M97818</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2018-04-12T11:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328625#M97819</link>
      <description>&lt;P&gt;You could use the transpose command to remove columns with only zeros:&lt;BR /&gt;
(Append to your search)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | transpose 
 | eval total=0
 | foreach row* [eval total=total + '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;']
 | where total &amp;gt; 0
 |fields - total
 | transpose header_field=column
 | fields - column
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 12:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328625#M97819</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-12T12:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328626#M97820</link>
      <description>&lt;P&gt;Try add this to your base search&lt;/P&gt;

&lt;P&gt;| transpose&lt;BR /&gt;
|  addtotals&lt;BR /&gt;
|  search Total&amp;gt;0&lt;BR /&gt;
|  fields- Total&lt;BR /&gt;
|  transpose header_field=column&lt;BR /&gt;
| fields - column&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 12:36:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328626#M97820</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2018-04-12T12:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328627#M97821</link>
      <description>&lt;P&gt;works perfectly as expected. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 01:57:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328627#M97821</guid>
      <dc:creator>Cbr1sg</dc:creator>
      <dc:date>2018-04-13T01:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328628#M97822</link>
      <description>&lt;P&gt;The solution by HeinzWaescher is shorter and it's not allowed to accept more than 1 answer, but this works as well. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 01:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328628#M97822</guid>
      <dc:creator>Cbr1sg</dc:creator>
      <dc:date>2018-04-13T01:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328629#M97823</link>
      <description>&lt;P&gt;because Column1 doesn't has only value "0" inside.&lt;BR /&gt;
Column2 and 3 are filtered because all of the values inside those 2 columns are "0"&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 02:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328629#M97823</guid>
      <dc:creator>Cbr1sg</dc:creator>
      <dc:date>2018-04-13T02:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328630#M97824</link>
      <description>&lt;P&gt;Yes, you got my question correctly. The dot is just a way to tell that there are more than 3 columns (could be 4, 5 or 20) in the table.&lt;BR /&gt;
Yes, the column header needs to be retained at the final result.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 02:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328630#M97824</guid>
      <dc:creator>Cbr1sg</dc:creator>
      <dc:date>2018-04-13T02:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to display only column(s) that has value greater than 0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328631#M97825</link>
      <description>&lt;P&gt;Yup I've made it a bit over complicated &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 10:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-only-column-s-that-has-value-greater-than-0/m-p/328631#M97825</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2018-04-13T10:38:28Z</dc:date>
    </item>
  </channel>
</rss>

