<?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 cross checking information between two sourcetypes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370077#M169852</link>
    <description>&lt;P&gt;I have two sourcetypes. first is a table of different pet types and respective animal. second is showing which pet is owned. Need to create a search that will show which pets-name are not owned:&lt;/P&gt;

&lt;P&gt;SourcetypeA:&lt;BR /&gt;
animal      name&lt;/P&gt;

&lt;P&gt;dog             howser&lt;BR /&gt;
dog             dodge&lt;BR /&gt;
cat              jake&lt;BR /&gt;
mouse       lola&lt;/P&gt;

&lt;P&gt;SourcetypeB:&lt;BR /&gt;
owner       pet-name&lt;/P&gt;

&lt;P&gt;Alvin       dog-dodge&lt;BR /&gt;
Ellie               cat-jake&lt;/P&gt;

&lt;P&gt;Tried using join and/or subsearch but cannot seem to get a table that shows  mouse-lola and dog-howser do not have owners.&lt;/P&gt;</description>
    <pubDate>Sat, 28 Apr 2018 05:42:19 GMT</pubDate>
    <dc:creator>asuratos</dc:creator>
    <dc:date>2018-04-28T05:42:19Z</dc:date>
    <item>
      <title>cross checking information between two sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370077#M169852</link>
      <description>&lt;P&gt;I have two sourcetypes. first is a table of different pet types and respective animal. second is showing which pet is owned. Need to create a search that will show which pets-name are not owned:&lt;/P&gt;

&lt;P&gt;SourcetypeA:&lt;BR /&gt;
animal      name&lt;/P&gt;

&lt;P&gt;dog             howser&lt;BR /&gt;
dog             dodge&lt;BR /&gt;
cat              jake&lt;BR /&gt;
mouse       lola&lt;/P&gt;

&lt;P&gt;SourcetypeB:&lt;BR /&gt;
owner       pet-name&lt;/P&gt;

&lt;P&gt;Alvin       dog-dodge&lt;BR /&gt;
Ellie               cat-jake&lt;/P&gt;

&lt;P&gt;Tried using join and/or subsearch but cannot seem to get a table that shows  mouse-lola and dog-howser do not have owners.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 05:42:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370077#M169852</guid>
      <dc:creator>asuratos</dc:creator>
      <dc:date>2018-04-28T05:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: cross checking information between two sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370078#M169853</link>
      <description>&lt;P&gt;adding comma to clarify the fields for each sourcetype&lt;/P&gt;

&lt;P&gt;SourcetypeA:&lt;BR /&gt;
animal, name&lt;/P&gt;

&lt;P&gt;dog, howser&lt;BR /&gt;
dog, dodge&lt;BR /&gt;
cat, jake&lt;BR /&gt;
mouse, lola&lt;/P&gt;

&lt;P&gt;SourcetypeB:&lt;BR /&gt;
owner, pet-name&lt;/P&gt;

&lt;P&gt;Alvin, dog-dodge&lt;BR /&gt;
Ellie, cat-jake&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 05:47:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370078#M169853</guid>
      <dc:creator>asuratos</dc:creator>
      <dc:date>2018-04-28T05:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: cross checking information between two sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370079#M169854</link>
      <description>&lt;P&gt;Also,   a solution that might be suggested is to use lookup. my concern with this is that the list from sourcetypeA might change more often. I read that using lookup is only good if the lookup table does not change as often.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Apr 2018 22:34:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370079#M169854</guid>
      <dc:creator>asuratos</dc:creator>
      <dc:date>2018-04-28T22:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: cross checking information between two sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370080#M169855</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval raw="dog howser:dog dodge:cat jake:mouse lola"
| makemv delim=":" raw
| mvexpand raw
| rename raw AS _raw
| rex "^(?&amp;lt;animal&amp;gt;\S+)\s+(?&amp;lt;name&amp;gt;\S+)$"
| eval sourcetype="SourcetypeA"
| append [
| makeresults
| eval raw="Alvin dog-dodge:Ellie cat-jake"
| makemv delim=":" raw
| mvexpand raw
| rename raw AS _raw
| rex "^(?&amp;lt;owner&amp;gt;\S+)\s+(?&amp;lt;pet_name&amp;gt;\S+)$"
| eval sourcetype="SourcetypeB" ]
| rename pet_name AS "pet-name"
| fields - _time

| rename COMMENT AS "Everything above generates sample event data; everything below is the solution"

| rex field="pet-name" "(?&amp;lt;animal&amp;gt;[^-]+)-(?&amp;lt;name&amp;gt;[^-]+)$"
| stats values(*) AS * BY animal
| eval owned=if(isnotnull(owner), "YES", "NO")
| stats values(name) AS name BY animal owned
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Apr 2018 23:22:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370080#M169855</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-04-28T23:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: cross checking information between two sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370081#M169856</link>
      <description>&lt;P&gt;I copied and pasted the code below.  it shows that for one of the dogs that is not owned, it does not say "No". I expect the same line to show which is same as mouse that is not owned.&lt;/P&gt;

&lt;P&gt;My goal is to understand how I can apply this to a sourcetypeA and sourcetypeB that has much larger data set. I suppose that if I apply it to my actual use case that follows the same pattern, I can skip eval=raw statements.&lt;/P&gt;

&lt;P&gt;this is close but may need a bit more tweak to the search command. thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Apr 2018 05:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370081#M169856</guid>
      <dc:creator>asuratos</dc:creator>
      <dc:date>2018-04-29T05:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: cross checking information between two sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370082#M169857</link>
      <description>&lt;P&gt;if actually have a lot of data that is already ingested into different events for sourcetypeA  and sourcetypeB, to type the command to cross check, do I just do the following?&lt;/P&gt;

&lt;P&gt;sourcetype=sourcetypeA&lt;BR /&gt;
 | rex "^(?\S+)\s+(?\S+)$"&lt;BR /&gt;
 | append [&lt;BR /&gt;
  sourcetype=sourcetypeB&lt;BR /&gt;
 | rex "^(?\S+)\s+(?\S+)$" ]&lt;BR /&gt;
 | rename pet_name AS "pet-name"&lt;BR /&gt;
 | fields - _time     ------    I am not sure what this line does&lt;/P&gt;

&lt;P&gt;| rename COMMENT AS "Everything above generates sample event data; everything below is the solution"&lt;/P&gt;

&lt;P&gt;| rex field="pet-name" "(?[^-]+)-(?[^-]+)$"&lt;BR /&gt;
 | stats values(*) AS * BY animal&lt;BR /&gt;
 | eval owned=if(isnotnull(owner), "YES", "NO")&lt;BR /&gt;
 | stats values(name) AS name BY animal owned&lt;/P&gt;</description>
      <pubDate>Sun, 29 Apr 2018 06:04:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370082#M169857</guid>
      <dc:creator>asuratos</dc:creator>
      <dc:date>2018-04-29T06:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: cross checking information between two sourcetypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370083#M169858</link>
      <description>&lt;P&gt;have you tried this?&lt;/P&gt;

&lt;P&gt;SourcetypeA &lt;BR /&gt;
| eval pet-name=animal+"-"+name &lt;BR /&gt;
| table pet-name &lt;BR /&gt;
| join pet-name type=outer &lt;BR /&gt;
    [ search SourcetypeB &lt;BR /&gt;
    | table pet-name owner] &lt;BR /&gt;
| where isnull(owner)&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 20:05:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/cross-checking-information-between-two-sourcetypes/m-p/370083#M169858</guid>
      <dc:creator>rslama</dc:creator>
      <dc:date>2018-05-03T20:05:09Z</dc:date>
    </item>
  </channel>
</rss>

