<?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: I wanted to search by comparing two String attibutes are unqual in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585546#M204013</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It those field are from you events and you want to compare content of them (removing spaces and tab) then you can do it like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where trim(addressVal) != trim(outAddressVal)&lt;/LI-CODE&gt;&lt;P&gt;If there are no spaces or tabs inside outer letters like " asdsda ". But if there are those inside string then you need to use your original without those ' over your fieldnames. If you are using it like 'addressVal ' then the fieldname &amp;nbsp;is 'addressVal ' not 'addressVal'.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2022 12:24:59 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2022-02-17T12:24:59Z</dc:date>
    <item>
      <title>How to search by comparing two String attributes that are unequal?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585438#M203963</link>
      <description>&lt;P&gt;Below is the usual Splunk Search line in addressVal is not equal to outAddressVal.&lt;/P&gt;
&lt;P&gt;I tried below Search but it did not help&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index= *  addressVal outAddressVal| where (rtrim(ltrim('addressVal ')) != rtrim(ltrim('outAddressVal')))&lt;/LI-CODE&gt;
&lt;P&gt;Content line is like below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;addressVal = WV ,outAddressVal= RA

addressVal = CA,outAddressVal= RA

addressVal = WV ,outAddressVal= RA

addressVal = WV ,outAddressVal= RA&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Feb 2022 22:04:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585438#M203963</guid>
      <dc:creator>akhil11</dc:creator>
      <dc:date>2022-02-16T22:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: I wanted to search by comparing two String attibutes are unqual</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585440#M203964</link>
      <description>&lt;P&gt;Are your fields addressVal and outAddressVal getting parsed out from the event? If they aren't your "where" won't work because you don't have anything to compare.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 21:53:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585440#M203964</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-16T21:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: I wanted to search by comparing two String attibutes are unqual</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585442#M203965</link>
      <description>&lt;P&gt;Thank you for your response. Yes - both the fields shows in the list of interested fields on left bottom side of splunk search&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 21:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585442#M203965</guid>
      <dc:creator>akhil11</dc:creator>
      <dc:date>2022-02-16T21:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: I wanted to search by comparing two String attibutes are unqual</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585494#M203990</link>
      <description>&lt;P&gt;And you're sure your field names are properly cased?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 08:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585494#M203990</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-17T08:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: I wanted to search by comparing two String attibutes are unqual</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585546#M204013</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It those field are from you events and you want to compare content of them (removing spaces and tab) then you can do it like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where trim(addressVal) != trim(outAddressVal)&lt;/LI-CODE&gt;&lt;P&gt;If there are no spaces or tabs inside outer letters like " asdsda ". But if there are those inside string then you need to use your original without those ' over your fieldnames. If you are using it like 'addressVal ' then the fieldname &amp;nbsp;is 'addressVal ' not 'addressVal'.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 12:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585546#M204013</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-02-17T12:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search by comparing two String attributes that are unequal?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585966#M204126</link>
      <description>&lt;P&gt;I think the confusion comes from how field name is constructed during extraction; specifically, the first field name is most likely&amp;nbsp;'&lt;FONT face="courier new,courier"&gt;addressVal&lt;/FONT&gt;', &lt;STRONG&gt;not&lt;/STRONG&gt;&amp;nbsp;'&lt;FONT face="courier new,courier"&gt;addressVal&lt;/FONT&gt; '. &amp;nbsp;Therefore,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= *  addressVal outAddressVal| where (rtrim(ltrim('addressVal')) != rtrim(ltrim('outAddressVal')))&lt;/LI-CODE&gt;&lt;P&gt;should work for your data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Meanwhile, Splunk's key-value extraction ignores spaces surrounding equal sign ("="), as well as trailing blanks after the last consecutive non-space character in value. &amp;nbsp;(Unless you use custom extraction algorithms.) &amp;nbsp;This means that the values probably do not contain spaces, either. &amp;nbsp;In other words,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= *  addressVal outAddressVal
| where 'addressVal' != 'outAddressVal'&lt;/LI-CODE&gt;&lt;P&gt;may suffice. &amp;nbsp;But if you feel necessary to both ltrim() and rtrim(),&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;'s suggestion of&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/TextFunctions#trim.28X.2CY.29" target="_blank" rel="noopener"&gt;trim()&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;would be a better choice.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 21:08:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-by-comparing-two-String-attributes-that-are/m-p/585966#M204126</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-21T21:08:33Z</dc:date>
    </item>
  </channel>
</rss>

