<?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 fields in different format from two different sources in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-fields-in-different-format-from-two-different/m-p/540302#M152844</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231592"&gt;@amsagg&lt;/a&gt;&amp;nbsp;Try Something like below,&lt;/P&gt;&lt;P&gt;index=stream_dns dest_asset_tag=*dns OR dest_asset_tag=A&lt;BR /&gt;| rex field=fieldB "(?&amp;lt;fieldB&amp;gt;[^\.]+)"&amp;nbsp; ## To extract first portion to match with your lookup filed value&lt;BR /&gt;| table fieldB&lt;BR /&gt;| eval Flag="1"&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup dnslookup.csv&lt;BR /&gt;| table fieldA&lt;BR /&gt;| rename fieldA as fieldB&lt;BR /&gt;| eval Flag="1"]&lt;BR /&gt;| eventstats sum(Flag) Flag by fieldB&lt;BR /&gt;| dedup fieldB&lt;BR /&gt;| where Flag=1 ##If the field value exists in both index &amp;amp; lookup, the flag will be set to 2. Hence filtering to 1&lt;BR /&gt;| table fieldB&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2021 19:22:39 GMT</pubDate>
    <dc:creator>Kwip</dc:creator>
    <dc:date>2021-02-17T19:22:39Z</dc:date>
    <item>
      <title>Comparing two fields in different format from two different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-fields-in-different-format-from-two-different/m-p/540184#M152792</link>
      <description>&lt;P&gt;Hi Everyone,&lt;BR /&gt;&lt;BR /&gt;I am trying to use&amp;nbsp; a lookup table and an index to get an output as a comparison of two fields from two different sources&lt;BR /&gt;&lt;BR /&gt;lookup has a field that is in the format like this (fieldA)&lt;BR /&gt;aaa&lt;BR /&gt;ddd&lt;BR /&gt;fff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;index has a field that is in the format like this (fieldB)&lt;BR /&gt;&lt;BR /&gt;aaa.ccc.com&lt;BR /&gt;ddd.ccc.com&lt;BR /&gt;eee.ccc.com&lt;BR /&gt;&lt;BR /&gt;index=stream_dns dest_asset_tag=*dns OR dest_asset_tag=A | append&lt;BR /&gt;[| inputlookup dnslookup.csv | table fieldA | rename fieldA as fieldB ] | stats count by&amp;nbsp; dest, fieldB&lt;BR /&gt;&lt;BR /&gt;The result should look like the missing fields from comparison of fieldA and fieldB in this format&lt;BR /&gt;eee&lt;BR /&gt;fff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 02:18:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-fields-in-different-format-from-two-different/m-p/540184#M152792</guid>
      <dc:creator>amsagg</dc:creator>
      <dc:date>2021-02-17T02:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two fields in different format from two different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-fields-in-different-format-from-two-different/m-p/540206#M152801</link>
      <description>&lt;P&gt;Firstly, you should convert aaa.ccc.com to aaa otherwise they will not match&lt;/P&gt;&lt;P&gt;Secondly, if you only want the mismatches, and not any detail, you could dedup fieldB before the append&lt;/P&gt;&lt;P&gt;Then, when you count by fieldB, if your count is greater than 1, it appears in both then index and the lookup, otherwise it is a difference&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 08:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-fields-in-different-format-from-two-different/m-p/540206#M152801</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-02-17T08:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two fields in different format from two different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-two-fields-in-different-format-from-two-different/m-p/540302#M152844</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231592"&gt;@amsagg&lt;/a&gt;&amp;nbsp;Try Something like below,&lt;/P&gt;&lt;P&gt;index=stream_dns dest_asset_tag=*dns OR dest_asset_tag=A&lt;BR /&gt;| rex field=fieldB "(?&amp;lt;fieldB&amp;gt;[^\.]+)"&amp;nbsp; ## To extract first portion to match with your lookup filed value&lt;BR /&gt;| table fieldB&lt;BR /&gt;| eval Flag="1"&lt;BR /&gt;| append&lt;BR /&gt;[| inputlookup dnslookup.csv&lt;BR /&gt;| table fieldA&lt;BR /&gt;| rename fieldA as fieldB&lt;BR /&gt;| eval Flag="1"]&lt;BR /&gt;| eventstats sum(Flag) Flag by fieldB&lt;BR /&gt;| dedup fieldB&lt;BR /&gt;| where Flag=1 ##If the field value exists in both index &amp;amp; lookup, the flag will be set to 2. Hence filtering to 1&lt;BR /&gt;| table fieldB&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 19:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-two-fields-in-different-format-from-two-different/m-p/540302#M152844</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2021-02-17T19:22:39Z</dc:date>
    </item>
  </channel>
</rss>

