<?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 those rows with a particular value in a particular value using |table command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344160#M101953</link>
    <description>&lt;P&gt;Hi sh254087,&lt;BR /&gt;
If you use the command &lt;CODE&gt;| fields - field2&lt;/CODE&gt;, this field isn't more available for searches, so the following &lt;CODE&gt;where&lt;/CODE&gt; command is always wrong!&lt;BR /&gt;
you have to insert the search condition before the &lt;CODE&gt;| fields - field2&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;Anyway it's a best practice to put all the conditions as left as you can and not after table command.&lt;BR /&gt;
So try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index  field2 != "testvaluexyz"
| table field1 field2 field3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 20 Apr 2018 13:57:16 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2018-04-20T13:57:16Z</dc:date>
    <item>
      <title>how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344157#M101950</link>
      <description>&lt;P&gt;I am applying few conditions and logic to come up with values for different fields. I'm then displaying them using teh table command, like - &lt;BR /&gt;
| table field1 field2 field3 etc&lt;/P&gt;

&lt;P&gt;I now want to display this table with a condition like  the table should display only those rows where a field has a particular value. Ex - Display only those rows where field2="testvaluexyz". something like - SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1 WHERE FIELD2="testvaluexyz" &lt;/P&gt;

&lt;P&gt;I'm trying with the below command after table command and getting any result.&lt;BR /&gt;
|fields - field2| where field2 != "testvaluexyz"&lt;/P&gt;

&lt;P&gt;I can guess this may not be the right way. Can someone please help achieve this?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:47:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344157#M101950</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2018-04-20T13:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344158#M101951</link>
      <description>&lt;P&gt;the fields command will remove field2 so your where clause has nothing to compare so just flip the order&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table field1 field2 field3 etc
| where field2 != "testvaluexyz"
| fields - field2 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:52:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344158#M101951</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-04-20T13:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344159#M101952</link>
      <description>&lt;P&gt;In your example you are removing field2 before using the filter&lt;/P&gt;

&lt;P&gt;Have you tried out:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;yourbase search&lt;/EM&gt; &lt;BR /&gt;
| search field2="testvaluexyz"&lt;BR /&gt;
| table field1 field2 field3&lt;/P&gt;

&lt;P&gt;In general you should filter as soon as possible. So if possible, filter it directly in the base search.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344159#M101952</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2018-04-20T13:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344160#M101953</link>
      <description>&lt;P&gt;Hi sh254087,&lt;BR /&gt;
If you use the command &lt;CODE&gt;| fields - field2&lt;/CODE&gt;, this field isn't more available for searches, so the following &lt;CODE&gt;where&lt;/CODE&gt; command is always wrong!&lt;BR /&gt;
you have to insert the search condition before the &lt;CODE&gt;| fields - field2&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;Anyway it's a best practice to put all the conditions as left as you can and not after table command.&lt;BR /&gt;
So try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=your_index  field2 != "testvaluexyz"
| table field1 field2 field3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 13:57:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344160#M101953</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-04-20T13:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344161#M101954</link>
      <description>&lt;P&gt;Just after posting this I got this resolved. Just came across an other question on the forum where someone had made a comparison(not similar to my problem but it helped) using ==, the opposite of how I was trying. Instead of removing fields which is having values not matching with my value, this would display only those rows with the values which would match my value. Somehow I did not think this way. &lt;/P&gt;

&lt;P&gt;So the solution is (as simple as)-&lt;BR /&gt;
| table field1 field2 field3&lt;BR /&gt;
| where field2 == "testvaluexyz" &lt;/P&gt;

&lt;P&gt;I probably did not know how all I could use the where condition! Lesson learned. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:00:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344161#M101954</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2018-04-20T14:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344162#M101955</link>
      <description>&lt;P&gt;Tried this. This is removing the field2 completely. &lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:05:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344162#M101955</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2018-04-20T14:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344163#M101956</link>
      <description>&lt;P&gt;That's what the &lt;CODE&gt;fields - field2&lt;/CODE&gt; command does.  I assumed you wanted to remove it &lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344163#M101956</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-04-20T14:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344164#M101957</link>
      <description>&lt;P&gt;@kmaron Thank you for the response. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344164#M101957</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2018-04-20T14:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344165#M101958</link>
      <description>&lt;P&gt;@cusello this would display the field with the non-matching values. the other way of what I needed. Just checked this as well with a small change - &lt;/P&gt;

&lt;P&gt;|where field2 == "testvaluexyz"&lt;BR /&gt;
|table field1 field2 field3&lt;/P&gt;

&lt;P&gt;This worked fine, just the way it did when I tried | where after | table command. &lt;/P&gt;

&lt;P&gt;Thank you too. Cheers. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344165#M101958</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2018-04-20T14:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344166#M101959</link>
      <description>&lt;P&gt;@HeinzWaescher This as well worked fine. Thank you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344166#M101959</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2018-04-20T14:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to display only those rows with a particular value in a particular value using |table command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344167#M101960</link>
      <description>&lt;P&gt;I wanted to remove the non matching entries alone and not the complete field. &lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 14:29:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-display-only-those-rows-with-a-particular-value-in-a/m-p/344167#M101960</guid>
      <dc:creator>sh254087</dc:creator>
      <dc:date>2018-04-20T14:29:36Z</dc:date>
    </item>
  </channel>
</rss>

