<?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 Fields and Applying Conditions From Multiple Sourcetypes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/687653#M234527</link>
    <description>&lt;P class="lia-align-left"&gt;Actually, the further I review this, the more confused I get.&amp;nbsp; &amp;nbsp;In your example, why did you split makes and models?&amp;nbsp; Is it necessary to append data from one sourcetype to the other?&amp;nbsp; I assume so, otherwise the where command would be invalid.&lt;/P&gt;&lt;P class="lia-align-left"&gt;You're right, though.&amp;nbsp; The last three commands are key to the search.&amp;nbsp; As powerful as Splunk is, I'd sure think there's a much simpler process to search multiple sourcetypes with conditions applied.&amp;nbsp; (There truly is no comparison between the two, but I could create this query using Access in about 30 seconds.&amp;nbsp; However, the amount of data I'm searching is far too large for Access...)&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thanks for any feedback you can provide.&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2024 19:58:29 GMT</pubDate>
    <dc:creator>goton1160</dc:creator>
    <dc:date>2024-05-15T19:58:29Z</dc:date>
    <item>
      <title>Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/686241#M234119</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; I've been a very basic user of Splunk for a while, but now have a need to perform more advanced searches.&amp;nbsp; I have two different sourcetypes within the same index.&amp;nbsp; Examples of the fields are below.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;index=vehicles&lt;/P&gt;&lt;P&gt;Sourcetype=autos&lt;BR /&gt;VIN&lt;BR /&gt;MAKE&lt;BR /&gt;MODEL&lt;/P&gt;&lt;P&gt;Sourcetype=cars&lt;BR /&gt;SN&lt;BR /&gt;&lt;SPAN&gt;MANUFACTURER&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;PRODUCT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd like to search and table VIN, MAKE, MODEL, MANUFACTURER and PRODUCT where -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;VIN=SN&lt;BR /&gt;&lt;SPAN&gt;MAKE &amp;lt;&amp;gt; MANUFACTURER&lt;BR /&gt;OR&lt;BR /&gt;MODEL&amp;lt;&amp;gt;PRODUCT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Basically, where VIN and SN match, if one or both of the other fields don't match, show me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm not sure if a join (VIN and SN) statement is the best approach in this case.&amp;nbsp; I've researched and found questions and answers related to searching and comparing multiple sourcetypes.&amp;nbsp; But, I've been unable to find examples that include conditions.&amp;nbsp; Any suggestions you can provide would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 22:23:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/686241#M234119</guid>
      <dc:creator>goton1160</dc:creator>
      <dc:date>2024-05-02T22:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/686247#M234121</link>
      <description>&lt;P&gt;Here is a very simple example of "joining" two different datasets together based on their common ID. Almost all of the example is just setting up some example data. What you really need are the last 3 lines.&lt;/P&gt;&lt;P&gt;If you paste this to a search window it will randomly return you some results if the PRODUCT contains MISMATCH - if you remove the last line of the example you will all results of the made up data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time

``` Make some data for Sourcetype=autos ```
| eval sourcetype="autos"
| eval MAKE=split("Audi,Porsche,Mercedes",",")
| mvexpand MAKE
| eval MODEL=case(MAKE="Audi", split("AU-123,AU-988", ","), MAKE="Porsche", split("PO-123,PO-988", ","), MAKE="Mercedes", split("MX-123,MX-988", ","))
| mvexpand MODEL
| eval VIN=case(MAKE="Audi", split("AU-VIN:12345678,AU-VIN:9876543", ","), MAKE="Porsche", split("PO-VIN:12345678,PO-VIN:9876543", ","), MAKE="Mercedes", split("MX-VIN:12345678,MX-VIN:9876543", ","))
| mvexpand VIN
| eval VIN=MODEL.":".VIN


``` Make some identical data for Sourcetype=autos ```
| append [
  | makeresults
  | fields - _time
  | eval sourcetype="cars"
  | eval MANUFACTURER=split("Audi,Porsche,Mercedes",",")
  | mvexpand MANUFACTURER
  | eval PRODUCT=case(MANUFACTURER="Audi", split("AU-123,AU-988", ","), MANUFACTURER="Porsche", split("PO-123,PO-988", ","), MANUFACTURER="Mercedes", split("MX-123,MX-988", ","))
  | mvexpand PRODUCT
  | eval SN=case(MANUFACTURER="Audi", split("AU-VIN:12345678,AU-VIN:9876543", ","), MANUFACTURER="Porsche", split("PO-VIN:12345678,PO-VIN:9876543", ","), MANUFACTURER="Mercedes", split("MX-VIN:12345678,MX-VIN:9876543", ","))
  | mvexpand SN
  | eval SN=PRODUCT.":".SN
  | eval PRODUCT=PRODUCT.if(random() % 100 &amp;lt; 10, "-MISMATCH", "")
]
``` Take the common field ```
| eval COMMON_ID=if(sourcetype="autos", VIN, SN)
| stats values(*) as * by COMMON_ID
| where MAKE!=MANUFACTURER OR MODEL!=PRODUCT&lt;/LI-CODE&gt;&lt;P&gt;Don't ever consider JOIN as the first option - it's not a Splunk way of doing things and has numerous limitations. Splunk uses stats ... BY COMMON_FIELD.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 23:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/686247#M234121</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-05-02T23:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/686621#M234202</link>
      <description>&lt;P&gt;Thanks for your response,&amp;nbsp;bowesmana!&amp;nbsp; You've got me headed in the right direction.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 20:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/686621#M234202</guid>
      <dc:creator>goton1160</dc:creator>
      <dc:date>2024-05-06T20:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/687653#M234527</link>
      <description>&lt;P class="lia-align-left"&gt;Actually, the further I review this, the more confused I get.&amp;nbsp; &amp;nbsp;In your example, why did you split makes and models?&amp;nbsp; Is it necessary to append data from one sourcetype to the other?&amp;nbsp; I assume so, otherwise the where command would be invalid.&lt;/P&gt;&lt;P class="lia-align-left"&gt;You're right, though.&amp;nbsp; The last three commands are key to the search.&amp;nbsp; As powerful as Splunk is, I'd sure think there's a much simpler process to search multiple sourcetypes with conditions applied.&amp;nbsp; (There truly is no comparison between the two, but I could create this query using Access in about 30 seconds.&amp;nbsp; However, the amount of data I'm searching is far too large for Access...)&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thanks for any feedback you can provide.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 19:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/687653#M234527</guid>
      <dc:creator>goton1160</dc:creator>
      <dc:date>2024-05-15T19:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688087#M234635</link>
      <description>&lt;P&gt;The reason for setting up the example data in that way is based on my understanding of your description of the problem.&lt;/P&gt;&lt;P&gt;Generally the easiest way to give advice is for you to post an example of the data from both types and demonstrate what you want to achieve with the output.&lt;/P&gt;&lt;P&gt;No you don't need to append - the whole makeresults/append section is about setting up an example data set to show how you go about joining the two.&lt;/P&gt;&lt;P&gt;If you can post an example of the two data sources, it would be easier to show how it should be done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 22:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688087#M234635</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-05-20T22:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688204#M234658</link>
      <description>&lt;P&gt;Thanks for the response, Bowesmana.&amp;nbsp; Understood.&lt;/P&gt;&lt;P&gt;Here are sourcetypes and field data examples.&lt;/P&gt;&lt;P&gt;Sourcetype=autos&lt;/P&gt;&lt;TABLE width="301"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;VIN&lt;/TD&gt;&lt;TD width="111"&gt;MAKE&lt;/TD&gt;&lt;TD width="71"&gt;MODEL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234ABCD&lt;/TD&gt;&lt;TD&gt;FORD&lt;/TD&gt;&lt;TD&gt;GT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;CHEVROLET&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;VIPER&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A12B3C4D&lt;/TD&gt;&lt;TD&gt;AUDI&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sourcetype=cars&lt;/P&gt;&lt;TABLE width="301"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;SN&lt;/TD&gt;&lt;TD width="111"&gt;MANUFACTURER&lt;/TD&gt;&lt;TD width="71"&gt;PRODUCT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234ABCD&lt;/TD&gt;&lt;TD&gt;FORD&lt;/TD&gt;&lt;TD&gt;GT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;CHEVY&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;CARAVAN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A1B2C3D4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to compare the two sourcetypes and see the results where VIN=SN, but MAKE!=MANUFACTURER OR MODEL!=PRODUCT. (Caveat - if any events in either sourcetype contain a null value, they can be ignored/excluded by the search.)&lt;/P&gt;&lt;P&gt;From the example data above, ideally the search would display the following fields, and results would contain these two events (because VIN and SN match, but "CHEVROLET" does not equal "CHEVY", and "VIPER" does not equal "CARAVAN").&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;TABLE width="554"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;VIN&lt;/TD&gt;&lt;TD width="85"&gt;MAKE&lt;/TD&gt;&lt;TD width="71"&gt;MODEL&lt;/TD&gt;&lt;TD width="75"&gt;SN&lt;/TD&gt;&lt;TD width="118"&gt;MANUFACTURER&lt;/TD&gt;&lt;TD width="86"&gt;PRODUCT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;CHEVROLET&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;CHEVY&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;VIPER&lt;/TD&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;CARAVAN&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps to clarify.&amp;nbsp; Please let me know if you have any questions or suggestions.&amp;nbsp; I appreciate your help!&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 18:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688204#M234658</guid>
      <dc:creator>goton1160</dc:creator>
      <dc:date>2024-05-21T18:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688205#M234659</link>
      <description>&lt;P&gt;Ugh....sorry.&amp;nbsp; I modified data in the examples as I was typing my last response, and didn't update each "table" as needed.&amp;nbsp; Here are correct values.&amp;nbsp; Sorry for the confusion!&amp;nbsp; I didn't see an option to edit or delete my last response.&lt;/P&gt;&lt;P&gt;Sourcetype=autos&lt;/P&gt;&lt;TABLE width="301"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;VIN&lt;/TD&gt;&lt;TD width="111"&gt;MAKE&lt;/TD&gt;&lt;TD width="71"&gt;MODEL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234ABCD&lt;/TD&gt;&lt;TD&gt;FORD&lt;/TD&gt;&lt;TD&gt;GT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;VIPER&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;CHEVROLET&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A1B2C3D4&lt;/TD&gt;&lt;TD&gt;AUDI&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sourcetype=cars&lt;/P&gt;&lt;TABLE width="301"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;SN&lt;/TD&gt;&lt;TD width="111"&gt;MANUFACTURER&lt;/TD&gt;&lt;TD width="71"&gt;PRODUCT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234ABCD&lt;/TD&gt;&lt;TD&gt;FORD&lt;/TD&gt;&lt;TD&gt;GT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;CARAVAN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;CHEVY&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A1B2C3D4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to compare the two sourcetypes and see the results where VIN=SN, but MAKE!=MANUFACTURER OR MODEL!=PRODUCT. (Caveat - if any events in either sourcetype contain a null value, they can be ignored/excluded by the search.)&lt;/P&gt;&lt;P&gt;From the example data above, ideally the search would display the following fields, and results would contain these two events (because VIN and SN match, but "VIPER" does not equal "CARAVAN", and "CHEVROLET" does not equal "CHEVY").&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;TABLE width="580"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;VIN&lt;/TD&gt;&lt;TD width="111"&gt;MAKE&lt;/TD&gt;&lt;TD width="71"&gt;MODEL&lt;/TD&gt;&lt;TD width="75"&gt;SN&lt;/TD&gt;&lt;TD width="118"&gt;MANUFACTURER&lt;/TD&gt;&lt;TD width="86"&gt;PRODUCT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;VIPER&lt;/TD&gt;&lt;TD&gt;ABCD1234&lt;/TD&gt;&lt;TD&gt;DODGE&lt;/TD&gt;&lt;TD&gt;CARAVAN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;CHEVROLET&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;TD&gt;1A2B3C4D&lt;/TD&gt;&lt;TD&gt;CHEVY&lt;/TD&gt;&lt;TD&gt;CORVETTE&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry again for the confusion.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 18:25:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688205#M234659</guid>
      <dc:creator>goton1160</dc:creator>
      <dc:date>2024-05-21T18:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688744#M234792</link>
      <description>&lt;P&gt;It's pretty straightforward to do that&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="VIN,MAKE,MODEL
1234ABCD,FORD,GT
ABCD1234,DODGE,VIPER
1A2B3C4D,CHEVROLET,CORVETTE
A1B2C3D4,AUDI,"
| eval sourcetype="autos"
| append [ 
| makeresults format=csv data="SN,MANUFACTURER,PRODUCT
1234ABCD,FORD,GT
ABCD1234,DODGE,CARAVAN
1A2B3C4D,CHEVY,CORVETTE
A1B2C3D4, ,A8"
  | eval sourcetype="cars"
]
``` Above is sample data setup, but imagine your data above has come from
    index=your_index sourcetype=autos OR sourcetype=cars
```
``` Now use VIN as the common field - there are actually many ways to do
    the same thing, but what you are doing here is to make the dc_XXX fields
    ones to be counted for uniqueness.
```
| eval VIN=coalesce(VIN, SN), dc_makes=coalesce(MAKE, MANUFACTURER), dc_models=coalesce(MODEL, PRODUCT)
``` Here there stats values collects all the original data - you may want
    to add a | fields statement here to limit to the fields you want
    It also counts the unique values of the dc_* fields which is the make
    and model from whichever sourcetype ```
| stats values(*) as * dc(dc_*) as dc_* by VIN
``` And now this will find your mismatch items ```
| where dc_makes&amp;gt;1 OR dc_models&amp;gt;1
| fields - sourcetype dc_*&lt;/LI-CODE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 00:32:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/688744#M234792</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-05-27T00:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Fields and Applying Conditions From Multiple Sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/689024#M234844</link>
      <description>&lt;P&gt;That works great!&amp;nbsp; Just what I was looking for.&lt;/P&gt;&lt;P&gt;Thanks much for your support, bowesmana!&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 18:30:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Fields-and-Applying-Conditions-From-Multiple/m-p/689024#M234844</guid>
      <dc:creator>goton1160</dc:creator>
      <dc:date>2024-05-29T18:30:19Z</dc:date>
    </item>
  </channel>
</rss>

