<?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 remove a column if only one column exists from a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-column-if-only-one-column-exists-from-a-search/m-p/408964#M118022</link>
    <description>&lt;P&gt;I have a timechart that shows the timechart of errors in a timeframe. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=......| eval error=if(apiHttpStatus!=200, apiErrorCode, "Success")&lt;BR /&gt;
                    | bin span=1m _time&lt;BR /&gt;
                    | stats count by _time, error &lt;BR /&gt;
                    | eventstats sum(count) as total by _time &lt;BR /&gt;
                    | eval perc=round((count*100)/total,2)&lt;BR /&gt;
                    | timechart span=1m values(perc) by error&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This correctly displays the timechart of the error in the given timeframe. However, I want to remove successes from the final view, but not from the count. If an error occurs 1% of the time, I don't want to see in the view that 99% of events are successes, but I can't filter out successes from the initial search. I've done this by adding&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| timechart span=1m values(perc) by error&lt;BR /&gt;
                    | fields - Success&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;After the timechart. However, this leads to the odd situation where if I have had no errors in the time window, the result is a table of time and nothing else, resulting in a weird visual. How do I remove all data (resulting in no results found) if the only results are successes?&lt;/P&gt;</description>
    <pubDate>Wed, 23 May 2018 21:20:49 GMT</pubDate>
    <dc:creator>brajaram</dc:creator>
    <dc:date>2018-05-23T21:20:49Z</dc:date>
    <item>
      <title>How to remove a column if only one column exists from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-column-if-only-one-column-exists-from-a-search/m-p/408964#M118022</link>
      <description>&lt;P&gt;I have a timechart that shows the timechart of errors in a timeframe. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=......| eval error=if(apiHttpStatus!=200, apiErrorCode, "Success")&lt;BR /&gt;
                    | bin span=1m _time&lt;BR /&gt;
                    | stats count by _time, error &lt;BR /&gt;
                    | eventstats sum(count) as total by _time &lt;BR /&gt;
                    | eval perc=round((count*100)/total,2)&lt;BR /&gt;
                    | timechart span=1m values(perc) by error&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This correctly displays the timechart of the error in the given timeframe. However, I want to remove successes from the final view, but not from the count. If an error occurs 1% of the time, I don't want to see in the view that 99% of events are successes, but I can't filter out successes from the initial search. I've done this by adding&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| timechart span=1m values(perc) by error&lt;BR /&gt;
                    | fields - Success&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;After the timechart. However, this leads to the odd situation where if I have had no errors in the time window, the result is a table of time and nothing else, resulting in a weird visual. How do I remove all data (resulting in no results found) if the only results are successes?&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 21:20:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-column-if-only-one-column-exists-from-a-search/m-p/408964#M118022</guid>
      <dc:creator>brajaram</dc:creator>
      <dc:date>2018-05-23T21:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove a column if only one column exists from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-column-if-only-one-column-exists-from-a-search/m-p/408965#M118023</link>
      <description>&lt;P&gt;Found a really simple solution, feel dumb now. Just need to append &lt;CODE&gt;| search error!=Success&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=......| eval error=if(apiHttpStatus!=200, apiErrorCode, "Success") | bin span=1m _time | stats count by _time, error | eventstats sum(count) as total by _time | eval perc=round((count*100)/total,2) | search error!=Success| timechart span=1m values(perc) by error&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 22:34:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-remove-a-column-if-only-one-column-exists-from-a-search/m-p/408965#M118023</guid>
      <dc:creator>brajaram</dc:creator>
      <dc:date>2018-05-23T22:34:48Z</dc:date>
    </item>
  </channel>
</rss>

