<?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: != in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242849#M176204</link>
    <description>&lt;PRE&gt;&lt;CODE&gt; index=aw_dispenser sourcetype=EnrolledDevices UserName!="SYSTEM" | where NOT UserName=serialNumber| table UserName OutletID serialNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Keys are always Case sensitive - Values are not Case sensitive by default, Field-names are Keys&lt;/P&gt;

&lt;P&gt;When you are starting to develop a search:&lt;BR /&gt;
Do first the search (without a where and table) to make sure you got Events&lt;BR /&gt;
Then add your &lt;CODE&gt;where&lt;/CODE&gt; modifier and see you have not as many events like before&lt;BR /&gt;
Then add your &lt;CODE&gt;table&lt;/CODE&gt; modifier and change from clever search mode to verbose search mode&lt;BR /&gt;
When Fields in a Table are empty , means in general the Field is empty (with a &lt;CODE&gt;""&lt;/CODE&gt;) or does not exist (with a NULL)... you have to take a look to the &lt;CODE&gt;events&lt;/CODE&gt; to figure out&lt;/P&gt;

&lt;P&gt;Without the events nobody here can say where your problems are. Especially when you are always change the case of keys in your descriptions of your problem.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2016 17:00:52 GMT</pubDate>
    <dc:creator>SierraX</dc:creator>
    <dc:date>2016-11-21T17:00:52Z</dc:date>
    <item>
      <title>!= in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242842#M176197</link>
      <description>&lt;P&gt;i have two fields uderid and serial number. i need to find all the machines whose userid is not equal to serial number. how to do that . i tried with != operator ,NOT operator and all,nothong worked.please help&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 07:38:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242842#M176197</guid>
      <dc:creator>mithragangothri</dc:creator>
      <dc:date>2016-11-20T07:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242843#M176198</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; {Base search} | eval eq=if(userid=snr, 1,2) | search eq=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 20 Nov 2016 13:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242843#M176198</guid>
      <dc:creator>SierraX</dc:creator>
      <dc:date>2016-11-20T13:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242844#M176199</link>
      <description>&lt;P&gt;Try the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/CommonEvalFunctions"&gt;match&lt;/A&gt; operator for &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Eval"&gt;eval&lt;/A&gt;/&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Where"&gt;where&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;You don't provide any events or your search, so I'm just guessing, but ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... Your base search ... | where not match(userid,serialnumber)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gets wonky if you have spaces in either field name, but if you can edit the question (or add a comment) with more information I'm sure we can get this sorted out for you.  &lt;/P&gt;

&lt;P&gt;Items to add that would help us help you?  One or two of the searches you tried (that gives us context), perhaps a couple of events (which gives us data patterns).  Be sure to use the code button to format each one!&lt;/P&gt;

&lt;P&gt;Happy Splunking, &lt;BR /&gt;
Rich&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 13:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242844#M176199</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-11-20T13:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242845#M176200</link>
      <description>&lt;P&gt;A search at splunk can't compare values from one key to another.&lt;BR /&gt;
Not sure other BigData tools can do that directly at the search.&lt;BR /&gt;
Anyway... the search was written very quick and the eval can also used as automatic generated field when needed. When you have it in a auto generated field... you can also filter it in your Base search&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 13:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242845#M176200</guid>
      <dc:creator>SierraX</dc:creator>
      <dc:date>2016-11-20T13:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242846#M176201</link>
      <description>&lt;P&gt;I wouldn't recommend &lt;CODE&gt;match()&lt;/CODE&gt; because it expects a regular expression as its second argument. Depending on your &lt;CODE&gt;serialnumber&lt;/CODE&gt; values that can get very ugly.&lt;BR /&gt;
Instead, use &lt;CODE&gt;!=&lt;/CODE&gt; or &lt;CODE&gt;NOT&lt;/CODE&gt; if you want "not equals": &lt;CODE&gt;| where userid != serialnumber&lt;/CODE&gt; or &lt;CODE&gt;| where NOT userid = serialnumber&lt;/CODE&gt;&lt;BR /&gt;
Be aware this is a case sensitive comparison.&lt;/P&gt;

&lt;P&gt;In the &lt;CODE&gt;search&lt;/CODE&gt; command - especially before the first pipe -, &lt;CODE&gt;userid != serialnumber&lt;/CODE&gt; treats &lt;CODE&gt;serialnumber&lt;/CODE&gt; as &lt;CODE&gt;"serialnumber"&lt;/CODE&gt; - you're looking for nonequality to a string. I'd say it's an early design decision in SPL to make searching for strings easier, at the cost of making comparing two fields with each other harder.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Nov 2016 16:39:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242846#M176201</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-11-20T16:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242847#M176202</link>
      <description>&lt;P&gt;HI All,&lt;BR /&gt;
thanks for your promt response. i tried all these possibility and no luck . &lt;BR /&gt;
i will explain more elaboratively .&lt;/P&gt;

&lt;P&gt;I need to know List of "outletID" where two field do NOT have same Value.&lt;BR /&gt;
The two fields being UserName ,  Serialnumber from known index and source type .&lt;/P&gt;

&lt;P&gt;i tried just like &lt;/P&gt;

&lt;P&gt;index=aw_dispenser  sourcetype=EnrolledDevices UserName!="SYSTEM" | where NOT  UserName=serialNumber| table UserName OutletID &lt;/P&gt;

&lt;P&gt;Also when i put |table username,outletid serialnumber it shows only username and outletid(only the 1st two fields).Why is this so?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 01:41:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242847#M176202</guid>
      <dc:creator>mithragangothri</dc:creator>
      <dc:date>2016-11-21T01:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242848#M176203</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=aw_dispenser sourcetype=EnrolledDevices UserName!="SYSTEM" | where UserName!=serialNumber| table UserName OutletID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Nov 2016 12:28:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242848#M176203</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-11-21T12:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242849#M176204</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; index=aw_dispenser sourcetype=EnrolledDevices UserName!="SYSTEM" | where NOT UserName=serialNumber| table UserName OutletID serialNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Keys are always Case sensitive - Values are not Case sensitive by default, Field-names are Keys&lt;/P&gt;

&lt;P&gt;When you are starting to develop a search:&lt;BR /&gt;
Do first the search (without a where and table) to make sure you got Events&lt;BR /&gt;
Then add your &lt;CODE&gt;where&lt;/CODE&gt; modifier and see you have not as many events like before&lt;BR /&gt;
Then add your &lt;CODE&gt;table&lt;/CODE&gt; modifier and change from clever search mode to verbose search mode&lt;BR /&gt;
When Fields in a Table are empty , means in general the Field is empty (with a &lt;CODE&gt;""&lt;/CODE&gt;) or does not exist (with a NULL)... you have to take a look to the &lt;CODE&gt;events&lt;/CODE&gt; to figure out&lt;/P&gt;

&lt;P&gt;Without the events nobody here can say where your problems are. Especially when you are always change the case of keys in your descriptions of your problem.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 17:00:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242849#M176204</guid>
      <dc:creator>SierraX</dc:creator>
      <dc:date>2016-11-21T17:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: != in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242850#M176205</link>
      <description>&lt;P&gt;The docs now explicitly mention how to compare fields: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Search#Comparing_two_fields"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/SearchReference/Search#Comparing_two_fields&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 08:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/in-splunk/m-p/242850#M176205</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-11-22T08:31:36Z</dc:date>
    </item>
  </channel>
</rss>

