<?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 fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442388#M125590</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;index=wineventlog host=ATLINFPSAS3 sourcetype="WinEventLog:Security"  ApolloClientReports NOT "*Symantec Endpoint Protection*" EventCode="4663" Object_Name != "*~*"
Account_Name!="svcirisadmin"
| fields Object_Name Account_Name
| eval path_segment = split(Object_Name,"\\") | mvexpand path_segment
| lookup NSAMasterListForClientReporting.csv  entity_name as path_segment OUTPUTNEW entity_type
| eval entity_type = if(match(path_segment,"\d{4}(_\d{2})?"), "report_period_folder",entity_type)
| eval entity_type = if(match(path_segment,".*\.(txt|xlsx|pdf|csv|xls)"), "file_name",entity_type) 
| eval {entity_type} = path_segment 
| stats values(areport_type) as areport_type,values(sreport_type) as sreport_type,values(client) as client,values(file_name) as file_name, values(report_category) as report_category,values(report_period_folder) as report_period_folder by Object_Name Account_Name 
| search NOT sreport_type="*" 
| fillnull value="NotDefined" client
| rex field=file_name "(?[[:alnum:]]+)"
| lookup NewMaster.csv entity_name as compareclient outputnew entity_type as entity_type1
| eval client=if(client="NotDefined",entity_type1,client)
| stats count(file_name) as counttotal by   Account_Name areport_type  client report_period_folder file_name  Object_Name
| table Object_Name areport_type   client report_period_folder file_name  Account_Name counttotal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file and compare with filename(compare filename=ExcelClientColumn)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval
client=if(client="NotDefined",entity_type1,client)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Idea is : If client column is null then read data from filename (split filename) then compare with CLientMaster(newmaster.csv) if data match with filename and columnname(entity_name) then added condition as client=if(client="NotDefined",entity_type1,client)&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:42:54 GMT</pubDate>
    <dc:creator>shishirkumar</dc:creator>
    <dc:date>2020-09-29T23:42:54Z</dc:date>
    <item>
      <title>fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442388#M125590</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=wineventlog host=ATLINFPSAS3 sourcetype="WinEventLog:Security"  ApolloClientReports NOT "*Symantec Endpoint Protection*" EventCode="4663" Object_Name != "*~*"
Account_Name!="svcirisadmin"
| fields Object_Name Account_Name
| eval path_segment = split(Object_Name,"\\") | mvexpand path_segment
| lookup NSAMasterListForClientReporting.csv  entity_name as path_segment OUTPUTNEW entity_type
| eval entity_type = if(match(path_segment,"\d{4}(_\d{2})?"), "report_period_folder",entity_type)
| eval entity_type = if(match(path_segment,".*\.(txt|xlsx|pdf|csv|xls)"), "file_name",entity_type) 
| eval {entity_type} = path_segment 
| stats values(areport_type) as areport_type,values(sreport_type) as sreport_type,values(client) as client,values(file_name) as file_name, values(report_category) as report_category,values(report_period_folder) as report_period_folder by Object_Name Account_Name 
| search NOT sreport_type="*" 
| fillnull value="NotDefined" client
| rex field=file_name "(?[[:alnum:]]+)"
| lookup NewMaster.csv entity_name as compareclient outputnew entity_type as entity_type1
| eval client=if(client="NotDefined",entity_type1,client)
| stats count(file_name) as counttotal by   Account_Name areport_type  client report_period_folder file_name  Object_Name
| table Object_Name areport_type   client report_period_folder file_name  Account_Name counttotal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file and compare with filename(compare filename=ExcelClientColumn)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval
client=if(client="NotDefined",entity_type1,client)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Idea is : If client column is null then read data from filename (split filename) then compare with CLientMaster(newmaster.csv) if data match with filename and columnname(entity_name) then added condition as client=if(client="NotDefined",entity_type1,client)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:42:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442388#M125590</guid>
      <dc:creator>shishirkumar</dc:creator>
      <dc:date>2020-09-29T23:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442389#M125591</link>
      <description>&lt;P&gt;Try replacing&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | search NOT sreport_type="*" 
 | fillnull value="NotDefined" client
 | rex field=file_name "(?[[:alnum:]]+)"
 | lookup NewMaster.csv entity_name as compareclient outputnew entity_type as entity_type1
 | eval client=if(client="NotDefined",entity_type1,client)
 | stats count(file_name) as counttotal by   Account_Name areport_type  client report_period_folder file_name  Object_Name
 | table Object_Name areport_type   client report_period_folder file_name  Account_Name counttotal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | search NOT sreport_type="*" 
 | rex field=file_name "(?[[:alnum:]]+)"
 | lookup NewMaster.csv entity_name as compareclient outputnew entity_type as entity_type1
 | eval client=coalesce(client, entity_type1)
 | stats count(file_name) as counttotal by   Account_Name areport_type  client report_period_folder file_name  Object_Name
 | table Object_Name areport_type   client report_period_folder file_name  Account_Name counttotal
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Mar 2019 12:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442389#M125591</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-03-17T12:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442390#M125592</link>
      <description>&lt;P&gt;NO buddy its not working still its filtering data upon second LookUP File&lt;/P&gt;

&lt;P&gt;Count coming as 46 but its should be 123 as we are only replacing null value on client with file name&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=wineventlog host=ATLINFPSAS3&lt;BR /&gt;
sourcetype="WinEventLog:Security" &lt;BR /&gt;
ApolloClientReports NOT "&lt;EM&gt;Symantec&lt;BR /&gt;
Endpoint Protection&lt;/EM&gt;" EventCode="4663"&lt;BR /&gt;
Object_Name != "&lt;EM&gt;~&lt;/EM&gt;"&lt;BR /&gt;
Account_Name!="svcirisadmin" | fields&lt;BR /&gt;
Object_Name Account_Name | eval&lt;BR /&gt;
path_segment = split(Object_Name,"\")&lt;BR /&gt;
| mvexpand path_segment | lookup&lt;BR /&gt;
NSAMasterListForClientReporting.csv &lt;BR /&gt;
entity_name as path_segment OUTPUTNEW&lt;BR /&gt;
entity_type | eval entity_type =&lt;BR /&gt;
if(match(path_segment,"\d{4}(_\d{2})?"),&lt;BR /&gt;
"report_period_folder",entity_type) |&lt;BR /&gt;
eval entity_type =&lt;BR /&gt;
if(match(path_segment,".&lt;EM&gt;.(txt|xlsx|pdf|csv|xls)"),&lt;BR /&gt;
"file_name",entity_type)  | eval&lt;BR /&gt;
{entity_type} = path_segment  | stats&lt;BR /&gt;
values(areport_type) as&lt;BR /&gt;
areport_type,values(sreport_type) as&lt;BR /&gt;
sreport_type,values(client) as&lt;BR /&gt;
client,values(file_name) as file_name,&lt;BR /&gt;
values(report_category) as&lt;BR /&gt;
report_category,values(report_period_folder) as report_period_folder by Object_Name&lt;BR /&gt;
Account_Name  | search NOT&lt;BR /&gt;
sreport_type="&lt;/EM&gt;"  | rex&lt;BR /&gt;
field=file_name&lt;BR /&gt;
"(?[[:alnum:]]+)" |&lt;BR /&gt;
lookup NewMaster.csv entity_name as&lt;BR /&gt;
compareclient outputnew entity_type as&lt;BR /&gt;
entity_type1 | eval&lt;BR /&gt;
client=coalesce(client, entity_type1)&lt;BR /&gt;
| stats count(file_name) as counttotal&lt;BR /&gt;
by   Account_Name areport_type  client&lt;BR /&gt;
report_period_folder file_name &lt;BR /&gt;
Object_Name | table Object_Name&lt;BR /&gt;
areport_type   client&lt;BR /&gt;
report_period_folder file_name &lt;BR /&gt;
Account_Name counttotal&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442390#M125592</guid>
      <dc:creator>shishirkumar</dc:creator>
      <dc:date>2020-09-29T23:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442391#M125593</link>
      <description>&lt;P&gt;Please Help me to resolve this issue as it not resolved ,&lt;/P&gt;

&lt;P&gt;Second LookUP file filtering values as its matching with lookupfile with filename and populating only which is matched value&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2019 16:15:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442391#M125593</guid>
      <dc:creator>shishirkumar</dc:creator>
      <dc:date>2019-03-17T16:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442392#M125594</link>
      <description>&lt;P&gt;Thanks Rich,&lt;/P&gt;

&lt;P&gt;But its not working &lt;/P&gt;

&lt;P&gt;index=wineventlog host=ATLINFPSAS3 sourcetype="WinEventLog:Security"  ApolloClientReports NOT "&lt;EM&gt;Symantec Endpoint Protection&lt;/EM&gt;" EventCode="4663" Object_Name != "&lt;EM&gt;~&lt;/EM&gt;"&lt;BR /&gt;
Account_Name!="svcirisadmin"&lt;BR /&gt;
| fields Object_Name Account_Name&lt;BR /&gt;
| eval path_segment = split(Object_Name,"\") | mvexpand path_segment&lt;BR /&gt;
| lookup NSAMasterListForClientReporting.csv  entity_name as path_segment OUTPUTNEW entity_type&lt;BR /&gt;
| eval entity_type = if(match(path_segment,"\d{4}(_\d{2})?"), "report_period_folder",entity_type)&lt;BR /&gt;
| eval entity_type = if(match(path_segment,".&lt;EM&gt;.(txt|xlsx|pdf|csv|xls)"), "file_name",entity_type) &lt;BR /&gt;
| eval {entity_type} = path_segment &lt;BR /&gt;
| stats values(areport_type) as areport_type,values(sreport_type) as sreport_type,values(client) as client,values(file_name) as file_name, values(report_category) as report_category,values(report_period_folder) as report_period_folder by Object_Name Account_Name &lt;BR /&gt;
| search NOT sreport_type="&lt;/EM&gt;" &lt;BR /&gt;
| rex field=file_name "(?[[:alnum:]]+)"&lt;BR /&gt;
| lookup NewMaster.csv entity_name as compareclient outputnew entity_type as entity_type1&lt;BR /&gt;
| eval client=coalesce(client, entity_type1)&lt;BR /&gt;
| stats count(file_name) as counttotal by   Account_Name areport_type  client report_period_folder file_name  Object_Name&lt;BR /&gt;
| table Object_Name areport_type   client report_period_folder file_name  Account_Name counttotal&lt;/P&gt;

&lt;P&gt;its Still giving me count of 47 records as it should come to 121 this is because of 2nd Lookup is filtering client name which match with FileName but as per this logic it should only work where client is null then this if condition should work ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:43:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442392#M125594</guid>
      <dc:creator>shishirkumar</dc:creator>
      <dc:date>2020-09-29T23:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442393#M125595</link>
      <description>&lt;P&gt;When you post SPL, please highlight the code and click the Binary (101010) button so the code is displayed properly.&lt;BR /&gt;
The &lt;CODE&gt;lookup&lt;/CODE&gt; command does not filter events.  It simply searches for the given field(s) in the lookup and returns the requested field(s) from the matching row.  Since the second lookup command contains neither 'client' nor 'FileName' field, those fields cannot be influencing the lookup.&lt;BR /&gt;
Have you run the second lookup independently to verify it returns the expected output for specific inputs?&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2019 19:05:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442393#M125595</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-03-17T19:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: fix this issue of filtering data in second LOOKUP as here Second lookup is only for checking condition when client is null to search lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442394#M125596</link>
      <description>&lt;P&gt;Yes I do,&lt;/P&gt;

&lt;P&gt;I ReRun below as your request : But its still happening same , only giving me those report which are belonging to excel file means that are match (46 records) but its should be those also which are not null in case of client column &lt;BR /&gt;
    index=wineventlog host=ATLINFPSAS3 sourcetype="WinEventLog:Security"  ApolloClientReports NOT "&lt;EM&gt;Symantec Endpoint Protection&lt;/EM&gt;" EventCode="4663" Object_Name != "&lt;EM&gt;~&lt;/EM&gt;"&lt;BR /&gt;
    Account_Name!="svcirisadmin"&lt;BR /&gt;
    | fields Object_Name Account_Name&lt;BR /&gt;
    | eval path_segment = split(Object_Name,"\") | mvexpand path_segment&lt;BR /&gt;
    | lookup NSAMasterListForClientReporting.csv  entity_name as path_segment OUTPUTNEW entity_type&lt;BR /&gt;
    | eval entity_type = if(match(path_segment,"\d{4}(_\d{2})?"), "report_period_folder",entity_type)&lt;BR /&gt;
    | eval entity_type = if(match(path_segment,".&lt;EM&gt;.(txt|xlsx|pdf|csv|xls)"), "file_name",entity_type) &lt;BR /&gt;
    | eval {entity_type} = path_segment &lt;BR /&gt;
    | fillnull value="N/A" areport_type &lt;BR /&gt;
    | fillnull value="NotDefined" client&lt;BR /&gt;
    | fillnull value="N/A" report_period_folder&lt;BR /&gt;
    | fillnull value="N/A" file_name&lt;BR /&gt;
    | fillnull value="N/A" Account_Name&lt;BR /&gt;
    | fillnull value="N/A" Object_Name&lt;BR /&gt;
    | stats values(areport_type) as areport_type,values(sreport_type) as sreport_type,values(client) as client,values(file_name) as file_name, values(report_category) as report_category,values(report_period_folder) as report_period_folder by Object_Name Account_Name &lt;BR /&gt;
    | search NOT sreport_type="&lt;/EM&gt;" &lt;BR /&gt;
    | rex field=file_name "(?&lt;COMPARECLIENT&gt;[[:alnum:]]+)"&lt;BR /&gt;
    | lookup NewMaster.csv entity_name as compareclient outputnew entity_type as entity_type1&lt;BR /&gt;
    | eval client=if(client="NotDefined",entity_type1,client)&lt;BR /&gt;
    | stats count(file_name) as counttotal by   Account_Name areport_type  client report_period_folder file_name  Object_Name&lt;BR /&gt;
    | table Object_Name areport_type   client report_period_folder file_name  Account_Name counttotal&lt;/COMPARECLIENT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:43:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/fix-this-issue-of-filtering-data-in-second-LOOKUP-as-here-Second/m-p/442394#M125596</guid>
      <dc:creator>shishirkumar</dc:creator>
      <dc:date>2020-09-29T23:43:21Z</dc:date>
    </item>
  </channel>
</rss>

