<?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 filter dynamically based on string match across two different lookups in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503467#M85764</link>
    <description>&lt;P&gt;HI rohankin,&lt;BR /&gt;
I was answering to your previous comment, but now I cannot see it, probably you deleted it, is it correct?&lt;/P&gt;

&lt;P&gt;Anyway you can filter results with a simple option in the first row&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Dataset1.csv WHERE "Application Name"=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 12:49:41 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-10-14T12:49:41Z</dc:date>
    <item>
      <title>How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503464#M85761</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am new to Splunk and am stuck at the this problem. To elaborate: &lt;/P&gt;

&lt;P&gt;I have attached example of datasets and the desired result table that I am working with here. &lt;BR /&gt;
Datasets that I am using are KVStore lookups. &lt;/P&gt;

&lt;P&gt;But basically I am trying to connect dataset 1 to dataset 2  bringing over attributes (Flag A,B &amp;amp; C) based on condition. &lt;BR /&gt;
Condition is applied to column "Application Name" and there is many to one mapping which is confusing me. &lt;/P&gt;

&lt;P&gt;Any help is greatly appreciated ! &lt;/P&gt;

&lt;P&gt;(PS: Key is to have value of Flag= True in the output if it is true for any of the application mapped to that device name)&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Rohan &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/7824i3E7CB9D951581FF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sat, 12 Oct 2019 18:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503464#M85761</guid>
      <dc:creator>rohankin</dc:creator>
      <dc:date>2019-10-12T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503465#M85762</link>
      <description>&lt;P&gt;HI rohankin,&lt;BR /&gt;
try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Dataset1.csv
| rename "Application Name" AS ApplicationName
| makemv delim="," ApplicationName
| mvexpand ApplicationName
| lookup Dataset2.csv "Application Name" AS ApplicationName OUTPUT Flag-A Flag-B Flag-C
| stats values(ApplicationName) AS ApplicationName values(Flag-A) AS Flag-A values(Flag-B) AS Flag-B values(Flag-C) AS Flag-C BY "Device name"
| rename ApplicationName AS "Application Name"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If possible, avoid spaces in field names!&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2019 11:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503465#M85762</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-13T11:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503466#M85763</link>
      <description>&lt;P&gt;Thanks for the quick reply !!!!! &lt;/P&gt;

&lt;P&gt;Did some work and as it turns out "Application Name" field has NULLs which might be affecting the results. And number do add up.&lt;/P&gt;

&lt;P&gt;So, dataset 1 has 9959 records that do not have NULL in it and final results after using your query have 9959 records so I guess it is excluding those which do not have any value in "Application Name"  field. &lt;/P&gt;

&lt;P&gt;Any way we can handle those NULL values ? Those devices that have nothing "Application Name" field should just get all the flags as "False" &lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 12:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503466#M85763</guid>
      <dc:creator>rohankin</dc:creator>
      <dc:date>2019-10-14T12:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503467#M85764</link>
      <description>&lt;P&gt;HI rohankin,&lt;BR /&gt;
I was answering to your previous comment, but now I cannot see it, probably you deleted it, is it correct?&lt;/P&gt;

&lt;P&gt;Anyway you can filter results with a simple option in the first row&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Dataset1.csv WHERE "Application Name"=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 12:49:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503467#M85764</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-14T12:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503468#M85765</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;

&lt;P&gt;Ya. Deleted the comment after I realized the mix-up with the NULL values. I thought about using * as you have stated but the problem is I don't want to limit results only to the devices that have the "Application Name ".&lt;/P&gt;

&lt;P&gt;Rather for devices that do not have anything in "Application Name" , I would want to display them in the output with all three flags set to "False". &lt;/P&gt;

&lt;P&gt;Meaning, the final output should have all the 27,223  records from Dataset 1. &lt;BR /&gt;
Out of which 9959 records will have flag values based on "Application Name" field while remaining will just have "False" flags as there is nothing in "Application Name" field in dataset 1 for those devices.&lt;/P&gt;

&lt;P&gt;Does that make sense ? &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Rohan &lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 14 Oct 2019 13:09:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503468#M85765</guid>
      <dc:creator>rohankin</dc:creator>
      <dc:date>2019-10-14T13:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503469#M85766</link>
      <description>&lt;P&gt;Hi  gcusello,&lt;BR /&gt;
Ya. I deleted the the comments after realizing the mix-up wit the NULL values but to answer you , I did try using Application Name"=*.  But I dont want to exclude any of the devices that have NULL values in "Application Name" field in dataset 1.&lt;/P&gt;

&lt;P&gt;For ex. &lt;BR /&gt;
Dataset 1(Devices):  Number of records: 27,223 &lt;/P&gt;

&lt;P&gt;Dataset 2(Applications): Number of records:4,919&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Desired Output: Expected number of results:27,223 &lt;BR /&gt;
where 9959 records will have Flag values based match between Dataset 1 and Dataset 2(Your initial query is doing this)&lt;/P&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;P&gt;remaining records (with "Application Name" NULL in dataset 1) will have all the flags set to False. &lt;/P&gt;

&lt;P&gt;I feel adding "Application Name"=* will only keep the rows from dataset 1 that has values in &lt;BR /&gt;
"Application Name" which I dont want to do. I want to keep all the 27,223 records in the output. &lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 13:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503469#M85766</guid>
      <dc:creator>rohankin</dc:creator>
      <dc:date>2019-10-14T13:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503470#M85767</link>
      <description>&lt;P&gt;HI rohankin,&lt;BR /&gt;
to add also the empty "Application Name", use this command:&lt;BR /&gt;
| eval Flag-A=if(isnull("Application Name"),"False",Flag-A), Flag-B=if(isnull("Application Name"),"False",Flag-B), Flag-C=if(isnull("Application Name"),"False",Flag-C)&lt;BR /&gt;
Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 14:43:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503470#M85767</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-14T14:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503471#M85768</link>
      <description>&lt;P&gt;Thanks Gcusello ! that worked like a charm. I will have to do some extra work on the data though as it has many duplicates, NULLs and garbage data. &lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 12:47:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503471#M85768</guid>
      <dc:creator>rohankin</dc:creator>
      <dc:date>2019-10-24T12:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter dynamically based on string match across two different lookups</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503472#M85769</link>
      <description>&lt;P&gt;Good work and happy splunking!&lt;BR /&gt;
If this answer solved your problem, please accept and/ot upvote it.&lt;/P&gt;

&lt;P&gt;Ciao and next time!&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 12:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-filter-dynamically-based-on-string-match-across-two/m-p/503472#M85769</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-24T12:52:58Z</dc:date>
    </item>
  </channel>
</rss>

