<?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: Comparing  two string values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113846#M30060</link>
    <description>&lt;P&gt;This one seemed like it would work but the table did not return any results.  Splunk said it found matching events... but the table returned noting and complained that there was some kind of issue with "| table Userid email | where Userid=email"&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2014 19:40:13 GMT</pubDate>
    <dc:creator>pmccomb</dc:creator>
    <dc:date>2014-01-15T19:40:13Z</dc:date>
    <item>
      <title>Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113840#M30054</link>
      <description>&lt;P&gt;I have email address' that are used as user names in two different source types in two different indices.   I am trying to compare the two in order to find a list of matches and also the list of ones that do not match for each.  I am doing something like this:&lt;BR /&gt;&lt;BR /&gt;
index="index1" OR index ="main" sourcetype="SessionCount" OR sourcetype="Identity" Userid=email | table Userid, email&lt;BR /&gt;
(I just want to output matching fields with this search)&lt;/P&gt;

&lt;P&gt;There are a lot of matches between the Userid and email -&amp;gt; I have run individual searches on each and compared the results.  However, I receive no matches.   Is there possibly an issue with the format of the strings or are there any time comparisons going on that may throw it off?   &lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2014 23:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113840#M30054</guid>
      <dc:creator>pmccomb</dc:creator>
      <dc:date>2014-01-14T23:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113841#M30055</link>
      <description>&lt;P&gt;your logic to compare is wrong, with Userid=email you are telling Splunk to look for events with the value "email" in the field Userid&lt;/P&gt;

&lt;P&gt;I take Userid is a field and then email is another field, right?&lt;/P&gt;

&lt;P&gt;If that's the case you would need something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="index1" OR index ="main" sourcetype="SessionCount" OR sourcetype="Identity" | table Userid email | where Userid=email  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jan 2014 23:55:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113841#M30055</guid>
      <dc:creator>asimagu</dc:creator>
      <dc:date>2014-01-14T23:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113842#M30056</link>
      <description>&lt;P&gt;This part is wrong?&lt;BR /&gt;
「Userid=email」&lt;/P&gt;

&lt;P&gt;For example if it is?&lt;BR /&gt;
&lt;SEARCH&gt;&lt;BR /&gt;
index="index1" OR index ="main" sourcetype="SessionCount" OR sourcetype="Identity" | stats values(sourcetype) by Userid, email&lt;/SEARCH&gt;&lt;/P&gt;

&lt;P&gt;&lt;OUTPUT&gt;&lt;BR /&gt;
Userid, email,values(sourcetype)&lt;BR /&gt;
001,a@a,SessionCount Identity&lt;BR /&gt;
002,b@a,SessionCount&lt;BR /&gt;
003,c@a,Identity&lt;/OUTPUT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 00:14:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113842#M30056</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2014-01-15T00:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113843#M30057</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;P&gt;Common values&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|set intersect [search index="index1" sourcetype="SessionCount" | stats count by Userid | fields - count ] [search index ="main" sourcetype="Identity" | stats count by email | rename email as UserId | fields - count]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Difference&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|set diff [search index="index1" sourcetype="SessionCount" | stats count by Userid | fields - count ] [search index ="main" sourcetype="Identity" | stats count by email | rename email as UserId | fields - count]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2014 01:07:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113843#M30057</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-01-15T01:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113844#M30058</link>
      <description>&lt;P&gt;Where do you learn this stuff?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 01:14:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113844#M30058</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-01-15T01:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113845#M30059</link>
      <description>&lt;P&gt;This did it.. thank you!  That was really helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 19:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113845#M30059</guid>
      <dc:creator>pmccomb</dc:creator>
      <dc:date>2014-01-15T19:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113846#M30060</link>
      <description>&lt;P&gt;This one seemed like it would work but the table did not return any results.  Splunk said it found matching events... but the table returned noting and complained that there was some kind of issue with "| table Userid email | where Userid=email"&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 19:40:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113846#M30060</guid>
      <dc:creator>pmccomb</dc:creator>
      <dc:date>2014-01-15T19:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113847#M30061</link>
      <description>&lt;P&gt;Not sure I see anywhere that this is matching the email/Userid values.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 19:41:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113847#M30061</guid>
      <dc:creator>pmccomb</dc:creator>
      <dc:date>2014-01-15T19:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing  two string values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113848#M30062</link>
      <description>&lt;P&gt;My requirement was also same like this, but its not working. I have two files like this.&lt;BR /&gt;
Name&lt;BR /&gt;&lt;BR /&gt;
abc&lt;BR /&gt;
def&lt;BR /&gt;
ghi&lt;/P&gt;

&lt;P&gt;Name0&lt;BR /&gt;
xyz&lt;BR /&gt;
abc&lt;BR /&gt;
ghi&lt;/P&gt;

&lt;P&gt;I am expecting common values which are present on both files and difference values.&lt;BR /&gt;
Eval / if - queries are not working due to values are misplaced in files. I was trying with below query for common values&lt;/P&gt;

&lt;P&gt;|set intersect [|inputcsv scc.csv |stats values(Name) as sccm] [|inputcsv lan.csv | stats values(Name0) as Lan] &lt;/P&gt;

&lt;P&gt;But its not giving any outputs tried by adding fields also, no luck. can any one help me on this.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2015 13:54:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-string-values/m-p/113848#M30062</guid>
      <dc:creator>vranjith009</dc:creator>
      <dc:date>2015-11-18T13:54:46Z</dc:date>
    </item>
  </channel>
</rss>

