<?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: Display only values found in two searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446872#M126736</link>
    <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=rap sourcetype="joyner lucas" albums=*) OR (index=country sourcetype="lil Nas" songs=*)
| eval check_match = coalesce(albums,songs)
| stats count by check_match 
| where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here is an example to try anywhere:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1
| eval data = "x,y,z,123;;;x,y,z,124;;;x,y,z,125;;;x,y,z,126;;;a,b,c,123;;;a,b,c,134;;;a,b,c,125;;;a,b,c,136"
| makemv delim=";;;" data 
| mvexpand data
| rex field=data "(?&amp;lt;idx&amp;gt;[^\,]+)\,(?&amp;lt;st&amp;gt;[^\,]+)\,(?&amp;lt;letter&amp;gt;[^\,]+)\,(?&amp;lt;number&amp;gt;.+)"
| eval album = if(idx=="x",number,null())
| eval song = if(idx="a",number,null())
| table idx st album song
| rename COMMENT as "the above generates data below is the solution" 
| search (idx=x st=y album=*) OR (idx=a st=b song=*)
| eval check_match = coalesce(album,song)
| stats count by check_match
| where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
    <pubDate>Sat, 04 May 2019 00:30:57 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2019-05-04T00:30:57Z</dc:date>
    <item>
      <title>Display only values found in two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446870#M126734</link>
      <description>&lt;P&gt;index=rap sourcetype="joyner lucas"&lt;BR /&gt;
| dedup albums| table albums&lt;BR /&gt;
|append [search index=country sourcetype="lil Nas"&lt;BR /&gt;
|dedup songs| table songs]&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 21:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446870#M126734</guid>
      <dc:creator>atl215</dc:creator>
      <dc:date>2019-05-03T21:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Display only values found in two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446871#M126735</link>
      <description>&lt;P&gt;I would like to list the values that match&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 21:59:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446871#M126735</guid>
      <dc:creator>atl215</dc:creator>
      <dc:date>2019-05-03T21:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Display only values found in two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446872#M126736</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=rap sourcetype="joyner lucas" albums=*) OR (index=country sourcetype="lil Nas" songs=*)
| eval check_match = coalesce(albums,songs)
| stats count by check_match 
| where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;here is an example to try anywhere:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1
| eval data = "x,y,z,123;;;x,y,z,124;;;x,y,z,125;;;x,y,z,126;;;a,b,c,123;;;a,b,c,134;;;a,b,c,125;;;a,b,c,136"
| makemv delim=";;;" data 
| mvexpand data
| rex field=data "(?&amp;lt;idx&amp;gt;[^\,]+)\,(?&amp;lt;st&amp;gt;[^\,]+)\,(?&amp;lt;letter&amp;gt;[^\,]+)\,(?&amp;lt;number&amp;gt;.+)"
| eval album = if(idx=="x",number,null())
| eval song = if(idx="a",number,null())
| table idx st album song
| rename COMMENT as "the above generates data below is the solution" 
| search (idx=x st=y album=*) OR (idx=a st=b song=*)
| eval check_match = coalesce(album,song)
| stats count by check_match
| where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2019 00:30:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446872#M126736</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-05-04T00:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Display only values found in two searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446873#M126737</link>
      <description>&lt;P&gt;From this answer, how would I chart the matches of this search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; (index=rap sourcetype="joyner lucas" albums=*) OR (index=country sourcetype="lil Nas" songs=*)
 | eval check_match = coalesce(albums,songs)
 | stats count by check_match 
 | where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 May 2019 14:00:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-only-values-found-in-two-searches/m-p/446873#M126737</guid>
      <dc:creator>atl215</dc:creator>
      <dc:date>2019-05-06T14:00:42Z</dc:date>
    </item>
  </channel>
</rss>

