<?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 remove a null field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141582#M39227</link>
    <description>&lt;P&gt;I had a similar issue where I was trying to display the data in a 2 column/multi-row format so I did this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| table datafield1 datafield2 datafield3 datafield4 datafield5 ...&lt;BR /&gt;
| transpose&lt;BR /&gt;
| rename column as Data "row 1" as Value&lt;BR /&gt;
| where Value NOT NULL&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This gives me the ability to put in as many fields as I want (which visually is very wide), flip it (| transpose) to only give me 2 columns, and remove  every row with no data (| where). Hope this helps. Thanks. &lt;/P&gt;</description>
    <pubDate>Fri, 29 May 2015 14:50:53 GMT</pubDate>
    <dc:creator>hogan24</dc:creator>
    <dc:date>2015-05-29T14:50:53Z</dc:date>
    <item>
      <title>How do I remove a null field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141579#M39224</link>
      <description>&lt;P&gt;Sometimes Splunk has extra null fields floating around (e.g., after &lt;CODE&gt;fields nosuchfield *&lt;/CODE&gt;). Is there a command which automatically removes fields which have only null values?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2015 09:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141579#M39224</guid>
      <dc:creator>tlagatta_splunk</dc:creator>
      <dc:date>2015-02-11T09:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove a null field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141580#M39225</link>
      <description>&lt;P&gt;Using &lt;CODE&gt;fields - nosuchfield&lt;/CODE&gt; is not satisfactory, since I might not know what the null field names are in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Feb 2015 09:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141580#M39225</guid>
      <dc:creator>tlagatta_splunk</dc:creator>
      <dc:date>2015-02-11T09:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove a null field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141581#M39226</link>
      <description>&lt;P&gt;@skawasaki_splunk provided a good answer to &lt;A href="http://answers.splunk.com/answers/61871/how-to-only-display-fields-with-values-in-a-table.html#answer-221341"&gt;How to only display fields with values in a table&lt;/A&gt;, which I adapted to my situation.&lt;/P&gt;

&lt;P&gt;If your records have a unique Id field, then the following snippet removes null fields:&lt;BR /&gt;
&lt;CODE&gt;| stats values(*) as * by Id&lt;/CODE&gt;&lt;BR /&gt;
The reason is that "stats values won't show fields that don't have at least one non-null value". &lt;/P&gt;

&lt;P&gt;If your records don't have a unique Id field, then you should create one first using streamstats:&lt;BR /&gt;
&lt;CODE&gt;| streamstats count as Id | stats values(*) as * by Id&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;(Warning: if your data has multivalued lists, then stats values will remove duplicates and &lt;A href="https://en.wikipedia.org/wiki/Lexicographical_order"&gt;sort lexicographically&lt;/A&gt;.)&lt;/P&gt;</description>
      <pubDate>Sat, 21 Mar 2015 01:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141581#M39226</guid>
      <dc:creator>tlagatta_splunk</dc:creator>
      <dc:date>2015-03-21T01:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I remove a null field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141582#M39227</link>
      <description>&lt;P&gt;I had a similar issue where I was trying to display the data in a 2 column/multi-row format so I did this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| table datafield1 datafield2 datafield3 datafield4 datafield5 ...&lt;BR /&gt;
| transpose&lt;BR /&gt;
| rename column as Data "row 1" as Value&lt;BR /&gt;
| where Value NOT NULL&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This gives me the ability to put in as many fields as I want (which visually is very wide), flip it (| transpose) to only give me 2 columns, and remove  every row with no data (| where). Hope this helps. Thanks. &lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2015 14:50:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-remove-a-null-field/m-p/141582#M39227</guid>
      <dc:creator>hogan24</dc:creator>
      <dc:date>2015-05-29T14:50:53Z</dc:date>
    </item>
  </channel>
</rss>

