<?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 list non common fields  of two table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251267#M75086</link>
    <description>&lt;P&gt;This worked as required, Thanks @woodcock &lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2017 08:43:01 GMT</pubDate>
    <dc:creator>ashish9433</dc:creator>
    <dc:date>2017-01-25T08:43:01Z</dc:date>
    <item>
      <title>How to list non common fields  of two table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251264#M75083</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I am looking to find out a solution where in i have two tables and i am interested in listing out only those fields which are not common. &lt;/P&gt;

&lt;P&gt;The below image list out the problem statement along with desired result.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2360i813215307AC89D60/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 10:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251264#M75083</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2017-01-24T10:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to list non common fields  of two table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251265#M75084</link>
      <description>&lt;P&gt;Hi ashish9433,&lt;/P&gt;

&lt;P&gt;you should build something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 
| eval count=0 
| append [ search search2 | stats count by Alfabet, No, TableName]
| stats sum(count) AS check by Alfabet, No, TableName
| where check=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in this way you list all the groups (Alfabet, No, TableName) of the first search that aren't present in the second one.&lt;BR /&gt;
If instead you want only the common groups you have tu use &lt;CODE&gt;| where check&amp;gt;0&lt;/CODE&gt; in your search.&lt;/P&gt;

&lt;P&gt;Beware that the three fields used in stats command must have the same name in both the searches.&lt;BR /&gt;
If values could have uppercases or lowercases differences, you have to transforms all values in the same case (upper or lower)&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 11:58:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251265#M75084</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-01-24T11:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to list non common fields  of two table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251266#M75085</link>
      <description>&lt;P&gt;For run-anywhere example and solution:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval raw="A,1,1:A,10,1:B,2,1:C,3,1:D,4,1:E,5,1:A,1,2:A,11,2:B,2,2:C,3,2:E,5,2:F,6,2:G,7,2"
| fields - _time
| makemv delim=":" raw
| mvexpand raw
| rex field=raw "^(?&amp;lt;Alphabet&amp;gt;[^,]*),(?&amp;lt;No&amp;gt;[^,]*),(?&amp;lt;TableName&amp;gt;[^,]*)$"
| eval TableName="Table" . TableName
| rename COMMENT AS "Everything above is spoofing events, everything below is the actual solution"
| eval AlphabetNo = Alphabet . ":" . No
| eval AlphabetNoTable = AlphabetNo . ":" . TableName
| eval AlphabetNoTableOther = AlphabetNo . ":" . if(TableName="Table1", "Table2", "Table1")
| eventstats values(AlphabetNoTable) AS AlphabetNoTables    
| where AlphabetNoTableOther != AlphabetNoTables
| table Alphabet No TableName
| sort 0 Alphabet TableName No
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jan 2017 17:48:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251266#M75085</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-01-24T17:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to list non common fields  of two table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251267#M75086</link>
      <description>&lt;P&gt;This worked as required, Thanks @woodcock &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 08:43:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251267#M75086</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2017-01-25T08:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to list non common fields  of two table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251268#M75087</link>
      <description>&lt;P&gt;This option didn't worked for me for some reason the result contained everything of table 1, but i wanted only contents which are non common.&lt;/P&gt;

&lt;P&gt;Thanks for your revert though!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 08:44:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-list-non-common-fields-of-two-table/m-p/251268#M75087</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2017-01-25T08:44:37Z</dc:date>
    </item>
  </channel>
</rss>

