<?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 compare each day's events to lookup table values and return differnces? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536066#M151559</link>
    <description>&lt;LI-CODE lang="markup"&gt;index=yours 
| lookup A as B OUTPUT C
| where NOT C!=""&lt;/LI-CODE&gt;&lt;P&gt;There are some fields that are only available in lookup, so filter them.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 22:05:33 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2021-01-15T22:05:33Z</dc:date>
    <item>
      <title>How to compare each day's events to lookup table values and return differnces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536043#M151545</link>
      <description>&lt;P&gt;I have a search that gets events related to procedures from the past week and organizes them into days. I also have a lookup table which holds the values of the procedure names I want to look for. This lookup table data has no date values, unlike my splunk data,&amp;nbsp; since I want to compare it against every day represented.&amp;nbsp; Search:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=app host=host1sourcetype=st1) OR (index=chub source=s2) earliest=-1w@w latest=now 
[|inputlookup chubDashboardProcedures.csv | fields 1.0_Procedures | rename 1.0_Procedures as search|format "" "(" "" ")" "OR" ""] 
| fields Procedure_Name,Process_Name,Activity_Code, UpdatedDate
| eval Procedure_Name=coalesce(Process_Name, Procedure_Name)
| eval update = strptime( UpdatedDate, "%Y-%m-%d %H:%M:%S")
| eval Day = relative_time(update,"@d") - if((tonumber(strftime(update, "%H%M")) &amp;lt; 1400),  (24*60*60), 0)
| dedup Procedure_Name Day
| append [|inputlookup chubDashboardProcedures.csv|fields   1.0_Procedures, UpdatedDate| rename 1.0_Procedures as Procedure_Name_New| eval from="lookup"]
| stats values(Procedure_Name_New) as lookup_procedures values(from) as from count(Procedure_Name) as fromcount values(Procedure_Name) as Procedure_Name_List values(eval(if(Activity_Code !="2000", Procedure_Name,null()))) as Failures by Day
| mvexpand lookup_procedures
| eval missing= if(match(Procedure_Name_List,lookup_procedures), "SAME", lookup_procedures)
| sort - Day
| eval Success_Percent = round(((Success_Count/Procedure_Count)*100),2)
| eval Day = strftime(Day, "%F")
| table Procedure_Name_List, lookup_procedures Failures missing&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The lookup table values are there and I can compare them to a list of procedures that&amp;nbsp;&lt;EM&gt;haven't&lt;/EM&gt; been grouped into dates, but as soon as I group into dates I can't compare them anymore. I want to display events that are found in the lookup table but not the events for each day.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 19:19:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536043#M151545</guid>
      <dc:creator>schilds427</dc:creator>
      <dc:date>2021-01-15T19:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare each day's events to lookup table values and return differnces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536066#M151559</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=yours 
| lookup A as B OUTPUT C
| where NOT C!=""&lt;/LI-CODE&gt;&lt;P&gt;There are some fields that are only available in lookup, so filter them.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 22:05:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536066#M151559</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-15T22:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare each day's events to lookup table values and return differnces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536084#M151566</link>
      <description>&lt;P&gt;Not sure that works for my situation. I can get the lookup table field values I want and can even run them through stats-values but if I try to group that data as I do my splunk data I can't work with it anymore.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if I just run :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=app host=host1 sourcetype=st1) OR (index=chub source=s1) earliest=-1w@w latest=now 
[|inputlookup chubDashboardProcedures.csv | fields 1.0_Procedures | rename 1.0_Procedures as search|format "" "(" "" ")" "OR" ""] 
| fields Procedure_Name,Process_Name,Activity_Code, UpdatedDate
| eval Procedure_Name=coalesce(Process_Name, Procedure_Name)
| dedup Procedure_Name 
| append [|inputlookup chubDashboardProcedures.csv|fields   1.0_Procedures| rename 1.0_Procedures as Procedure_Name_New]
| stats values(Procedure_Name_New) as Lookup_Procedure_List values(Procedure_Name) as Procedure_List count(eval(Activity_Code = "2000")) as Success_Count, values(eval(if(Activity_Code !="2000", Procedure_Name,null()))) as Failures, count as Procedure_Count
| table Procedure_List Lookup_Procedure_List&lt;/LI-CODE&gt;&lt;P&gt;That gives me two lists:&amp;nbsp; one that's the procedures from splunk and one that's the procedures from my lookup table. But if I try grouping the data by date my lookup procedure list becomes empty.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 23:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536084#M151566</guid>
      <dc:creator>schilds427</dc:creator>
      <dc:date>2021-01-15T23:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare each day's events to lookup table values and return differnces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536091#M151567</link>
      <description>&lt;P&gt;That's fine because you can see the results, but we don't know anything.&lt;BR /&gt;You can do it.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2021 00:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-each-day-s-events-to-lookup-table-values-and/m-p/536091#M151567</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-16T00:10:43Z</dc:date>
    </item>
  </channel>
</rss>

