<?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: Multiple sourcetypes combine datasets similar to concept Index-to-Match in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634127#M220263</link>
    <description>&lt;P&gt;I forgot to filter out data contributed from SourceB that had no match in SourceA.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" date&amp;lt;2023-02-14 env=envA)
| eval ID = if(sourcetype == "SourceA", ID_a, ID) ``` use ID as universal field name ```
| fields ID, name, title, description, solution, date, env, sourcetype
| stats count values(*) AS * BY ID ``` not by name ```
| where sourcetype == "SourceA" ``` side effect of SPL's multivalue equality ```
| lookup lookuptable.csv trimmed_name ``` match trimmed_name ```&lt;/LI-CODE&gt;&lt;P&gt;The where filter should be &lt;FONT face="andale mono,times"&gt;mvcount(sourcetype) &amp;gt; 1 OR sourcetype == "SourceA"&lt;/FONT&gt;; but SPL allows equality operator to match any one of multiple values if one side of the operator is a single value.&lt;/P&gt;</description>
    <pubDate>Sat, 11 Mar 2023 18:45:58 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2023-03-11T18:45:58Z</dc:date>
    <item>
      <title>Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633819#M220135</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I have been scouring the community and other boards but for the life of me cannot create a SPL query to get the results I need. Below is what I am trying to accomplish, any direction and help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;I have 2 sourcetypes and 1 lookup table.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SourceA has fields (ID_a, name, date, trimmed_name, env, etc..)&lt;/LI&gt;&lt;LI&gt;SourceB has fields (ID, title_id, title, description solution, etc...)&lt;/LI&gt;&lt;LI&gt;Lookup has fields (trimmed_name, department, etc...)&lt;/LI&gt;&lt;LI&gt;SourceA gets updated weekly, therefore in the existing query I have &lt;STRONG&gt;earliest=-7d&lt;/STRONG&gt;&amp;nbsp;to exclude previous data&lt;/LI&gt;&lt;LI&gt;Characteristics of SourceA: &lt;STRONG&gt;name&lt;/STRONG&gt; is the only unique field, &lt;STRONG&gt;ID_a&lt;/STRONG&gt; will be duplicated across &lt;STRONG&gt;name&lt;/STRONG&gt; depending on &lt;STRONG&gt;date&lt;/STRONG&gt; field, &lt;STRONG&gt;env&lt;/STRONG&gt; is duplicated across the dataset, &lt;STRONG&gt;trimmed_name&lt;/STRONG&gt; is a field created from trimming &lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;SourceA &lt;STRONG&gt;ID_a&lt;/STRONG&gt; and SourceB &lt;STRONG&gt;ID&lt;/STRONG&gt; are the common field between the two datasets&lt;/LI&gt;&lt;LI&gt;Characteristics of SourceB: there are duplicates of &lt;STRONG&gt;ID, title_id, title, description, solution&lt;/STRONG&gt;. When deduping &lt;STRONG&gt;title_id,&lt;/STRONG&gt; values of&amp;nbsp;&lt;STRONG&gt;title, description, solution, etc...&lt;/STRONG&gt;&amp;nbsp;are dedup'd and become unique.&amp;nbsp;This is why I called SourceB a knowledge base. We can dedup SourceB down to the fields above to get a finite list.&lt;/LI&gt;&lt;LI&gt;SourceB will have multiple values of &lt;STRONG&gt;ID&lt;/STRONG&gt;. But we only need to return fields\values where the dedup'd SourceA &lt;STRONG&gt;ID_a&lt;/STRONG&gt; exists. This means from 100 events in SourceA, dedup'd by &lt;STRONG&gt;ID_a&lt;/STRONG&gt;, results in 2 &lt;STRONG&gt;ID_a&lt;/STRONG&gt;. These 2 &lt;STRONG&gt;ID_a&lt;/STRONG&gt; values is what we to find in Source B and return&amp;nbsp;&lt;STRONG&gt;title_id, title, description solution&lt;/STRONG&gt; values for.&lt;/LI&gt;&lt;LI&gt;At a minimum, final results needed per source are:&amp;nbsp;&lt;UL&gt;&lt;LI&gt;SourceA: &lt;STRONG&gt;name&lt;/STRONG&gt;, &lt;STRONG&gt;date&lt;/STRONG&gt;, &lt;STRONG&gt;env&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;SourceB: &lt;STRONG&gt;title_id, title, description, solution &lt;/STRONG&gt;(other fields can be omitted, assuming we can add specific fields back as needed)&lt;/LI&gt;&lt;LI&gt;Lookup: &lt;STRONG&gt;department&lt;/STRONG&gt;&amp;nbsp;(other fields can be omitted, assuming we can add specific fields back as needed)&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;SourceA:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="594px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="183.281px" height="25px"&gt;ID_a&lt;/TD&gt;&lt;TD width="184.984px" height="25px"&gt;name&lt;/TD&gt;&lt;TD width="121.883px" height="25px"&gt;trimmed_name&lt;/TD&gt;&lt;TD width="102.852px" height="25px"&gt;date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="183.281px" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="184.984px" height="25px"&gt;ABC_n&lt;/TD&gt;&lt;TD width="121.883px" height="25px"&gt;AB&lt;/TD&gt;&lt;TD width="102.852px" height="25px"&gt;01/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;ABC_n1&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;TD&gt;01/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;ABC_n2&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;TD&gt;01/03/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="183.281px" height="25px"&gt;XYZ&lt;/TD&gt;&lt;TD width="184.984px" height="25px"&gt;XYZ_n&lt;/TD&gt;&lt;TD width="121.883px" height="25px"&gt;XY&lt;/TD&gt;&lt;TD width="102.852px" height="25px"&gt;02/01/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;XYZ&lt;/TD&gt;&lt;TD&gt;XYZ_n1&lt;/TD&gt;&lt;TD&gt;XY&lt;/TD&gt;&lt;TD&gt;02/02/2023&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SourceB:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ID&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;title_id&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;title&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;description&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;solution&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;12345&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_d&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_s&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_d1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_s1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;93648&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t2&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_d2&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_s2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_t&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_d&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_s&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;38840&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_t1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_d1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_s1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;MNO&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;43245&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;MNO_t&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;MNO_d&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;MNO_s&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;MNO&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;36485&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;MNO_t1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;MNO_d1&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;MNO_s1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;RST&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;84678&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;RST_t&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;RST_d&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;RST_s&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Lookup Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="244.5px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="122.234px" height="25px"&gt;trimmed_name&lt;/TD&gt;&lt;TD width="121.266px" height="25px"&gt;department&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="122.234px" height="25px"&gt;AB&lt;/TD&gt;&lt;TD width="121.266px" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="122.234px" height="25px"&gt;XY&lt;/TD&gt;&lt;TD width="121.266px" height="25px"&gt;XYZ_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="122.234px"&gt;MN&lt;/TD&gt;&lt;TD width="121.266px"&gt;MNO_dep&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Intended Result:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" width="96.875%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;sourceA.name&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;sourceB.title_id&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;sourceB.title&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;sourceB.description&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;sourceB.solution&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;sourceA.date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;lookup.department&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_n&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;12345&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/01/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_n&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d1&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s1&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/01/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_n&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;93648&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d2&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s2&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/01/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_n1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;12345&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/02/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_n1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d1&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s1&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/02/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_n1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;93648&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d2&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s2&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/02/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;ABC_n2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;12345&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/03/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;ABC_n2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d1&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s1&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/03/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%"&gt;ABC_n2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;93648&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d2&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s2&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;01/03/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_n&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_t&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_d&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;XYZ_s&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;02/01/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_n&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;38840&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_t1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_d1&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;XYZ_s1&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;02/01/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_n&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_t&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_d&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;XYZ_s&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;02/02/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_dep&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_n&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;38840&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_t1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_d1&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;XYZ_s1&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;02/02/2023&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_dep&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Query, I have been playing with... From what I gather, I have events for the query but nothing displays when I try to get data from SourceB and SourceA at the same time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" date&amp;lt;2023-02-14 env=envA)
| rename ID_a AS ID
| fields ID, name, title, description, solution, date, env
| stats count values(*) AS * values(date) values(title) values(env) BY name
| where count=1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 03:53:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633819#M220135</guid>
      <dc:creator>TangSauce</dc:creator>
      <dc:date>2023-03-11T03:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633821#M220136</link>
      <description>&lt;P&gt;It looks like you're thinking along the right track.&lt;/P&gt;&lt;P&gt;The common property between sourceA and sourceB is "ID" so that is what we should group by.&lt;/P&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" date&amp;lt;2023-02-14 env=envA)
| eval drop=if(sourcetype="SourceA", 1, null())
| eval ID = coalesce(ID, ID_a)
| table ID, name, title, description, solution, date, env
| eventstats latest(name) as name, latest(trimmed_name) as trimmed_name, latest(date) as date by ID
| where isnull(drop)
| fields - drop
| lookup lookuptable.csv trimmed_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Essentially, we're using sourceB as our main dataset, extracting what we need from sourceA and then dropping the sourceA events from the search results. Then finally it looks like we need to lookup using trimmed_name from your example data.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 17:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633821#M220136</guid>
      <dc:creator>Tom_Lundie</dc:creator>
      <dc:date>2023-03-09T17:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633919#M220167</link>
      <description>&lt;P&gt;Thanks for the quick reply! Unfortunately, looks like the query is still only returning data from one source.&amp;nbsp; I played with the query to simplify to just returning 2 data points from SourceA and SourceB, but was unable get it to work.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The original query shows no results&lt;/LI&gt;&lt;LI&gt;Removing the following starts to show results&amp;nbsp;&lt;PRE&gt;| where isnotnull(drop)
| fields - drop&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here is an example of what is being returned.&lt;/P&gt;&lt;TABLE border="1" width="96.875%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;&lt;SPAN&gt;sourceA.na&lt;/SPAN&gt;me&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;sourceB.title_id&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;sourceB.title&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;sourceB.description&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;sourceB.solution&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;sourceA.date&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;lookup.department&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;12345&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t1&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d1&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s1&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;93648&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;ABC_t2&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;ABC_d2&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;ABC_s2&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="12.5%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;23456&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;XYZ_t&lt;/TD&gt;&lt;TD width="12.5%" height="25px"&gt;XYZ_d&lt;/TD&gt;&lt;TD width="6.25%" height="25px"&gt;XYZ_s&lt;/TD&gt;&lt;TD width="3.125%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="25%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 09 Mar 2023 16:31:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633919#M220167</guid>
      <dc:creator>TangSauce</dc:creator>
      <dc:date>2023-03-09T16:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633927#M220170</link>
      <description>&lt;P&gt;Hi TangSauce,&lt;/P&gt;&lt;P&gt;You're welcome but apologies, I had a typo in my example search, that should have been:&lt;/P&gt;&lt;PRE&gt;| where isnull(drop)
| fields - drop&lt;/PRE&gt;&lt;P&gt;I have updated my original post to reflect that.&lt;/P&gt;&lt;P&gt;That should be working now, but your search results are not looking promising...&lt;/P&gt;&lt;P&gt;I've just noticed that you have a date parameter for sourceA are you trying to search different timeranges between the two sources?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" date&amp;lt;2023-02-14 env=envA)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If date field is being extracted as the _time field for SourceA, Splunk can do the heavy lifting for your filtering:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" latest="02/14/2023:00:00:00" env=envA)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise you'll need to manually filter the dates out yourself:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" env=envA)
| where sourcetype="SourceB" OR (strptime(date, "%Y-%m-%d") &amp;gt; strptime("2023-02-14", "%Y-%m-%d"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Either way, focus on writing a search that gets the correct data that you require from SourceA and SourceB together. Make sure that data from both SourceA and SourceB are present with the first section of the search.&lt;/P&gt;&lt;P&gt;Then you can use the rest of the search from my original answer to achieve the overall goal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval drop=if(sourcetype="SourceA", 1, null())
| eval ID = coalesce(ID, ID_a)
| table ID, name, title, description, solution, date, env
| eventstats latest(name) as name, latest(trimmed_name) as trimmed_name, latest(date) as date by ID
| where isnull(drop)
| fields - drop
| lookup lookuptable.csv trimmed_name&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 17:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/633927#M220170</guid>
      <dc:creator>Tom_Lundie</dc:creator>
      <dc:date>2023-03-09T17:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634099#M220233</link>
      <description>&lt;P&gt;Thanks again for the help. Still struggling and trying different ways to get the search to return or at least include the dataset and fields I need. Again, running into only being able to show values from SourceB but not SourceA. The date field in SourceA does not equal _time, but is specific to when the name field was changed (1-1 relationship).&lt;/P&gt;&lt;P&gt;I assume I would need to confirm the returned results are from both SourceA and SourceB via Events (~7.9k events). I have been able to play with python to achieve the goal but, not everyone in my org will be able access this data via a spreadsheet.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 20:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634099#M220233</guid>
      <dc:creator>TangSauce</dc:creator>
      <dc:date>2023-03-10T20:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634111#M220242</link>
      <description>&lt;P&gt;Problems in your first search:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When you rename ID_a as ID, you also erase any value of ID that comes from sourceB. &amp;nbsp;You need to pull value discretely.&lt;/LI&gt;&lt;LI&gt;Field name only exists in SourceA. &amp;nbsp;The stats command's groupby will exclude any data from SourceB.&lt;/LI&gt;&lt;LI&gt;The last filter will further exclude any "name" that appear in more than one event in SourceA, which is very unlikely.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Based on your description, you want to&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pull all fields of interest in SourceA;&lt;/LI&gt;&lt;LI&gt;add fields of interest in SourceB if ID_a in the former matches ID in the latter; and&lt;/LI&gt;&lt;LI&gt;pull additional fields from lookup if trimmed_name in SourceA is found in the lookup.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Combining these, the search should be something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" date&amp;lt;2023-02-14 env=envA)
| eval ID = if(sourcetype == "SourceA", ID_a, ID) ``` use ID as universal field name ```
| fields ID, name, title, description, solution, date, env
| stats count values(*) AS * BY ID ``` not by name ```
| lookup lookuptable.csv trimmed_name ``` match trimmed_name ```&lt;/LI-CODE&gt;&lt;P&gt;Here, I assume that you didn't intend to find singular ID. &amp;nbsp;But if you need any real restriction on count, you can add it.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 23:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634111#M220242</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-03-10T23:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634117#M220247</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Based on your description, you want to&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;pull all fields of interest in SourceA;&lt;/LI&gt;&lt;LI&gt;add fields of interest in SourceB if ID_a in the former matches ID in the latter; and&lt;/LI&gt;&lt;LI&gt;pull additional fields from lookup if trimmed_name in SourceA is found in the lookup.&lt;/LI&gt;&lt;/UL&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The above is accurate. However, the sample query you provide is still returning data from SourceB only.&lt;/P&gt;&lt;P&gt;Apologizes to all, but I may not be describing the problem and expected results inaccurately. Appreciate all the help so far nonetheless.&lt;/P&gt;&lt;P&gt;I updated my original post to provide more clarity.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Mar 2023 01:59:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634117#M220247</guid>
      <dc:creator>TangSauce</dc:creator>
      <dc:date>2023-03-12T01:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634122#M220261</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval ID=coalesce(ID, ID_a)
| fields ID, name, title_id, title, description, solution, date, env
| stats list(*) AS * BY ID
| where env="envA"
| eval repA=mvrange(0,mvcount(name))
| mvexpand repA
| foreach name date env
    [| eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=mvindex(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, repA)]
| eval repB=mvrange(0,mvcount(title_id))
| mvexpand repB
| foreach title_id title description solution
    [| eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=mvindex(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, repB)]&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 11 Mar 2023 10:33:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634122#M220261</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-11T10:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes combine datasets similar to concept Index-to-Match</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634127#M220263</link>
      <description>&lt;P&gt;I forgot to filter out data contributed from SourceB that had no match in SourceA.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="myindex" (sourcetype="SourceB" type=INFO) OR (sourcetype="SourceA" date&amp;lt;2023-02-14 env=envA)
| eval ID = if(sourcetype == "SourceA", ID_a, ID) ``` use ID as universal field name ```
| fields ID, name, title, description, solution, date, env, sourcetype
| stats count values(*) AS * BY ID ``` not by name ```
| where sourcetype == "SourceA" ``` side effect of SPL's multivalue equality ```
| lookup lookuptable.csv trimmed_name ``` match trimmed_name ```&lt;/LI-CODE&gt;&lt;P&gt;The where filter should be &lt;FONT face="andale mono,times"&gt;mvcount(sourcetype) &amp;gt; 1 OR sourcetype == "SourceA"&lt;/FONT&gt;; but SPL allows equality operator to match any one of multiple values if one side of the operator is a single value.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 18:45:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-sourcetypes-combine-datasets-similar-to-concept-Index/m-p/634127#M220263</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-03-11T18:45:58Z</dc:date>
    </item>
  </channel>
</rss>

