<?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 find same values in different sources in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/605327#M210495</link>
    <description>&lt;P&gt;OK Thanks - that would have been useful to know up front though!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2022 18:19:18 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-07-12T18:19:18Z</dc:date>
    <item>
      <title>How to find same values in different sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/604866#M210360</link>
      <description>&lt;P&gt;Our login page is developed by team1 and the main home page (After login) is developed by team2. The event logs from each use completely different structures. I strongly suspect unique system identifiers in the login logs may be carried into the home page logs, but I don't know which fields (out of 20-50 fields in each log) may contain similar values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a method to find fields that have the same value in both sources if I don't know which fields to match on?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(index=A sourcetype="login" colA="apple", colB="ABC123" , colC="purple")&lt;BR /&gt;(index=B sourcetype="home" field1="yellow", field2="orange", ..., field20="ABC123", field21="Monkey")&lt;/P&gt;
&lt;P&gt;How can I search both sources to identify ( login.colB == home.field20) if I don't know in advance those fields match? I may not find ANY common values...&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 18:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/604866#M210360</guid>
      <dc:creator>Momgineer</dc:creator>
      <dc:date>2022-07-12T18:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find same values in different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/604879#M210364</link>
      <description>&lt;P&gt;Do the unique system identifiers have a known and consistent format e.g. AAANNN as in your example? If so, you could try extracting a new field with rex based on this pattern&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex max_match=0 "\"(?&amp;lt;uid&amp;gt;[a-zA-Z]{3}\d{3})\""&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Jul 2022 05:26:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/604879#M210364</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-08T05:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to find same values in different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/604889#M210367</link>
      <description>&lt;P&gt;If you just want to find fields with the same value, you can use something like that:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="A" sourcetype="login") OR (index="B" sourcetype="home")
|  eval kv = "---"
| foreach *
 [|  eval kv = mvappend(kv, index + ":" + sourcetype + ":&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" + "|" + '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
 | eval kv=mvfilter(!match(kv, "---"))
 | fields kv
 | mvexpand kv
 | makemv kv delim="|"
 | eval field=mvindex(kv,0)
 | eval value=mvindex(kv,1)
 | stats values(field) as fields by value
 | where mvcount(fields) &amp;gt; 1&lt;/LI-CODE&gt;&lt;P&gt;This should give you a table of values and a fields list this value appears in.&lt;/P&gt;&lt;P&gt;For example, the below query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|  makeresults 1
| eval index="A", sourcetype="login", colA="apple", colB="ABC123" , colC="purple"
| append 
    [| makeresults 1
    | eval index="B", sourcetype="home", field1="yellow", field2="orange", field3="lemon", field4="tomato", field5="potato", field20="ABC123", field21="Monkey"]
|  eval kv = "---"
| foreach *
 [|  eval kv = mvappend(kv, index + ":" + sourcetype + ":&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;" + "|" + '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
 | eval kv=mvfilter(!match(kv, "---"))
 | fields kv
 | mvexpand kv
 | makemv kv delim="|"
 | eval field=mvindex(kv,0)
 | eval value=mvindex(kv,1)
 | stats values(field) as fields by value
 | where mvcount(fields) &amp;gt; 1&lt;/LI-CODE&gt;&lt;P&gt;produces the following results:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;value&lt;/TD&gt;&lt;TD width="50%"&gt;fields&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;ABC123&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;P&gt;A:login:colB&lt;BR /&gt;B:home:field20&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;which means that value "ABC123" appears in index A sourcetype login colB and index B sourcetype home field20&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 07:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/604889#M210367</guid>
      <dc:creator>JacekF</dc:creator>
      <dc:date>2022-07-08T07:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find same values in different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/605325#M210493</link>
      <description>&lt;LI-SPOILER&gt;This is great! Exactly what I was hoping for. Thank you!&lt;/LI-SPOILER&gt;</description>
      <pubDate>Tue, 12 Jul 2022 18:15:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/605325#M210493</guid>
      <dc:creator>Momgineer</dc:creator>
      <dc:date>2022-07-12T18:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to find same values in different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/605326#M210494</link>
      <description>&lt;P&gt;Thank you for the input. Unfortunately, they are just random system-generated UIDs:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1d1d33c5-0e5a-4cbe-afc4-c8c514ff62f4&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;d9be033a-703c-4f6b-a5de-c514f80e1a47&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 18:17:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/605326#M210494</guid>
      <dc:creator>Momgineer</dc:creator>
      <dc:date>2022-07-12T18:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to find same values in different sources</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/605327#M210495</link>
      <description>&lt;P&gt;OK Thanks - that would have been useful to know up front though!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 18:19:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-same-values-in-different-sources/m-p/605327#M210495</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-12T18:19:18Z</dc:date>
    </item>
  </channel>
</rss>

