<?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 How to hide empty columns in a table on a simple XML dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161698#M9954</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I'm going crazy with a table in Splunk.&lt;BR /&gt;
What I'm trying to do is to dynamically create a table based on non null fields in my events.&lt;BR /&gt;
I'm using a Simple XML dashboard.&lt;BR /&gt;
This is the environment:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Event1: _time  fieldA=&amp;lt;valueA&amp;gt;  fieldB=&amp;lt;valueB&amp;gt;  fieldC=&amp;lt;valueC&amp;gt;  fieldD=&amp;lt;valueD&amp;gt;  fieldE=&amp;lt;valueE&amp;gt;
Event2: _time  fieldA=&amp;lt;valueA&amp;gt;  fieldB=&amp;lt;valueB&amp;gt;  fieldC=&amp;lt;valueC&amp;gt;  fieldF=&amp;lt;valueF&amp;gt;  fieldG=&amp;lt;valueG&amp;gt;
Event3: ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I use a search string like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;my_index&amp;gt; fieldD=&amp;lt;valueD&amp;gt; | table *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The generated table appears like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time    fieldA    fieldB    fieldC    fieldD    fieldE    fieldF    fieldG
&amp;lt;time&amp;gt;   &amp;lt;valueA&amp;gt;  &amp;lt;valueB&amp;gt;  &amp;lt;valueC&amp;gt;  &amp;lt;valueD&amp;gt;  &amp;lt;valueE&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why does Splunk show the empty columns too?&lt;BR /&gt;
How can I change my search to solve this issue?&lt;BR /&gt;
Maybe it seems an easy thing but I'm not finding a solution.&lt;BR /&gt;
Help me please! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Oct 2014 21:10:16 GMT</pubDate>
    <dc:creator>djluke</dc:creator>
    <dc:date>2014-10-13T21:10:16Z</dc:date>
    <item>
      <title>How to hide empty columns in a table on a simple XML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161698#M9954</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;
I'm going crazy with a table in Splunk.&lt;BR /&gt;
What I'm trying to do is to dynamically create a table based on non null fields in my events.&lt;BR /&gt;
I'm using a Simple XML dashboard.&lt;BR /&gt;
This is the environment:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Event1: _time  fieldA=&amp;lt;valueA&amp;gt;  fieldB=&amp;lt;valueB&amp;gt;  fieldC=&amp;lt;valueC&amp;gt;  fieldD=&amp;lt;valueD&amp;gt;  fieldE=&amp;lt;valueE&amp;gt;
Event2: _time  fieldA=&amp;lt;valueA&amp;gt;  fieldB=&amp;lt;valueB&amp;gt;  fieldC=&amp;lt;valueC&amp;gt;  fieldF=&amp;lt;valueF&amp;gt;  fieldG=&amp;lt;valueG&amp;gt;
Event3: ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I use a search string like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;my_index&amp;gt; fieldD=&amp;lt;valueD&amp;gt; | table *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The generated table appears like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time    fieldA    fieldB    fieldC    fieldD    fieldE    fieldF    fieldG
&amp;lt;time&amp;gt;   &amp;lt;valueA&amp;gt;  &amp;lt;valueB&amp;gt;  &amp;lt;valueC&amp;gt;  &amp;lt;valueD&amp;gt;  &amp;lt;valueE&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why does Splunk show the empty columns too?&lt;BR /&gt;
How can I change my search to solve this issue?&lt;BR /&gt;
Maybe it seems an easy thing but I'm not finding a solution.&lt;BR /&gt;
Help me please! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2014 21:10:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161698#M9954</guid>
      <dc:creator>djluke</dc:creator>
      <dc:date>2014-10-13T21:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide empty columns in a table on a simple XML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161699#M9955</link>
      <description>&lt;P&gt;With a search such as &lt;STRONG&gt;……. ….|table ***  If you desire for exemle to remove a Colum on the displayed result, you can transform your search to  **...|table * |fields – fieldName&lt;/STRONG&gt;  where fieldName  is the field you don’t want to display.&lt;BR /&gt;
You can do it for many fields at once like this &lt;STRONG&gt;….|table * |fields – fieldName1, fieldName2,…&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;This is an exemple that display all fields except the fields host an index &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;index=* |table *|fields - host ,index&lt;/STRONG&gt;  &lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2014 08:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161699#M9955</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2014-12-17T08:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide empty columns in a table on a simple XML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161700#M9956</link>
      <description>&lt;P&gt;Thanks for your answer.&lt;BR /&gt;
I already knew there was the possibility to "filter" results using the fields command, but my question was related to the results shown by "table" command.&lt;BR /&gt;
I can't predict which columns will be empty or filled before launching the search function. I'd like splunk to show me only NOT NULL columns.&lt;BR /&gt;
Is it possible?&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2014 08:38:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161700#M9956</guid>
      <dc:creator>djluke</dc:creator>
      <dc:date>2014-12-18T08:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide empty columns in a table on a simple XML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161701#M9957</link>
      <description>&lt;P&gt;@djluke &lt;/P&gt;

&lt;P&gt;add this query end of your query .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| streamstats count as temp_count
  | stats values(*) as * by temp_count
  | fields - temp_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Dec 2019 11:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/161701#M9957</guid>
      <dc:creator>nida__firdous</dc:creator>
      <dc:date>2019-12-26T11:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to hide empty columns in a table on a simple XML dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/560636#M38990</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also facing this issue of displaying&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;only NOT NULL columns. in splunk table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone help in this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 17:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-hide-empty-columns-in-a-table-on-a-simple-XML-dashboard/m-p/560636#M38990</guid>
      <dc:creator>splunk_newer1</dc:creator>
      <dc:date>2021-07-23T17:49:47Z</dc:date>
    </item>
  </channel>
</rss>

