<?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 a field value with an entire column or CSV in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113347#M23714</link>
    <description>&lt;P&gt;You understood perfectly! Had to tweak it 1 last time to filter out any blanks &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where numTypes=1 AND type=1 AND teams!=""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But now it works perfectly, thank you a lot!&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2015 13:13:24 GMT</pubDate>
    <dc:creator>jarrex</dc:creator>
    <dc:date>2015-07-13T13:13:24Z</dc:date>
    <item>
      <title>Comparing a field value with an entire column or CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113345#M23712</link>
      <description>&lt;P&gt;I have been searching for how to do this for the longest time and it's rather frustrating that I can't seem to find a simple explanation anywhere. &lt;/P&gt;

&lt;P&gt;I have a search setup and a CSV file that lists a bunch of "blacklist" items that I do not want included in the results I have tried just about everything with regards to the CSV and I have seen no progress. It got to the point that I have now been trying to append the CSV and then just search the value within the appended column but there doesn't seem to be a way to search a CONTAINS within a different column.&lt;/P&gt;

&lt;P&gt;Here is what I want to do:&lt;/P&gt;

&lt;P&gt;I have a table that looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Name    Teams   Removed Team    TeamDels
Bob Team A  Yes           TeamA
Bob Team B  No            TeamE
Jane    Team C  No            TeamF
Jane    Team D  No            TeamG
Jane    Team E  Yes           TeamH
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I am currently thinking I am going to have to do is append the CSV (TeamDels column) and then somehow do a search if Teams contains a value in TeamDels but I can't do this?&lt;/P&gt;

&lt;P&gt;Removed Team would be calculated by looking at the Team value (Team A, Team B etc.) and seeing if it is in the blacklist. If it is in the black list is says Yes.&lt;/P&gt;

&lt;P&gt;I do not care how to go about doing this, I can even remove the Removed Team column if there was a way to filter out the teams based on the contents of the CSV file but there doesn't seem to be a way.&lt;/P&gt;

&lt;P&gt;It should be noted that the "Teams" are multivalue to start so I have to split them.&lt;/P&gt;

&lt;P&gt;DeletedTeamList.csv contains 1 column with the header TeamDels&lt;/P&gt;

&lt;P&gt;Here is my current search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=teams action=* 
| append [inputlookup DeletedTeamList.csv] 
| table Name,Teams,Removed_Team
| mvexpand Teams 
| eval Removed_Team=If(Teams!=TeamDels,"No","Yes")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I typo'd anything on here please ignore as these aren't the real fields or anything.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 18:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113345#M23712</guid>
      <dc:creator>jarrex</dc:creator>
      <dc:date>2015-07-10T18:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a field value with an entire column or CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113346#M23713</link>
      <description>&lt;P&gt;I am not sure that I understand but perhaps this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=teams action=* | eval type=1 | append [| inputlookup DeletedTeamList.csv | rename TeamDels AS "Teams" | table Teams | eval type=2] | mvexpand Teams | stats values(*) AS * dc(type) AS numTypes BY Teams | where numTypes=1 AND type=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will show you all (fields for) events in the first search whose value for &lt;CODE&gt;Teams&lt;/CODE&gt; is not found in the lookup file in any entry's &lt;CODE&gt;TeamDels&lt;/CODE&gt;.  Is that what you desire?  If not, perhaps you can tweak the &lt;CODE&gt;where&lt;/CODE&gt; part a bit differently.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 20:46:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113346#M23713</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-10T20:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a field value with an entire column or CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113347#M23714</link>
      <description>&lt;P&gt;You understood perfectly! Had to tweak it 1 last time to filter out any blanks &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where numTypes=1 AND type=1 AND teams!=""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But now it works perfectly, thank you a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 13:13:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113347#M23714</guid>
      <dc:creator>jarrex</dc:creator>
      <dc:date>2015-07-13T13:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a field value with an entire column or CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113348#M23715</link>
      <description>&lt;P&gt;Could you explain 1 thing to me? When appending the CSV and renaming the column, does that cause the two identically named columns to merge?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 13:15:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113348#M23715</guid>
      <dc:creator>jarrex</dc:creator>
      <dc:date>2015-07-13T13:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing a field value with an entire column or CSV</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113349#M23716</link>
      <description>&lt;P&gt;Not exactly.  When I append the second dataset, it does exactly that.  But before I let Splunk append it, I need to normalize the field &lt;CODE&gt;TeamDels&lt;/CODE&gt; to match the field in the first dataset.  That way I can do a breakout across the combined dataset by a field that exists in both sets.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 05:40:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-a-field-value-with-an-entire-column-or-CSV/m-p/113349#M23716</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-17T05:40:04Z</dc:date>
    </item>
  </channel>
</rss>

