<?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: csv lookup for search query based on continuity and 7-day condition in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561254#M163875</link>
    <description>&lt;P&gt;Hi&amp;nbsp; ITWhisperer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your responses. I am testing your logic on the paid Splunk virtual environment and Splunk still does not send another alert for the person on day3 when he is flagged and is sent an alert on Day1, disappear on Day2, and flagged again on Day3. I wonder if it works for you?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very respectfully,&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 20:06:45 GMT</pubDate>
    <dc:creator>longmen</dc:creator>
    <dc:date>2021-07-28T20:06:45Z</dc:date>
    <item>
      <title>csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560647#M159337</link>
      <description>&lt;P&gt;Hi Splunk Experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if you could help me putting the below logic in to a search query?&lt;/P&gt;&lt;P&gt;Here the link reference to my original question.&lt;BR /&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/kv-store-search-send-alert-and-also-store-the-the-alert-sent/m-p/560289#M159234" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/kv-store-search-send-alert-and-also-store-the-the-alert-sent/m-p/560289#M159234&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"The logic of your requirement seems to be that there are two situations when a user appears in the audit (satisfying the conditions). Either, they are in the list of alerts from yesterday, or they are not. If they were not in the list from yesterday, send an alert and add them to the list (noting when they were added). If they were in the list, don't send an alert but note they were there. now, process the list and remove anyone who didn't appear today (so that an alert will be generated next time they appear on the list), Also, remove anyone who has been on the list for 7 days including today (so that an alert will be generated next time they appear on the list, even if it is tomorrow - day 8)."&lt;/P&gt;&lt;TABLE width="734"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64"&gt;Day&lt;/TD&gt;&lt;TD width="74"&gt;Audit name&lt;/TD&gt;&lt;TD width="118"&gt;Alert name at start&lt;/TD&gt;&lt;TD width="140"&gt;Alert sent date at start&lt;/TD&gt;&lt;TD width="140"&gt;Alert name at end&lt;/TD&gt;&lt;TD width="134"&gt;Alert sent date at end&lt;/TD&gt;&lt;TD width="64"&gt;Send alert&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;James&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;James&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Michael&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Michael&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;James&lt;/TD&gt;&lt;TD&gt;James&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;James&lt;/TD&gt;&l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&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Michael&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;James&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;James&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Michael&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 23 Jul 2021 19:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560647#M159337</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-23T19:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560671#M159345</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Using the csv files from the previous answer and taking a 7 minute rather than 7 day expiry on the alerts, the runanywhere example becomes&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup audit.csv
| lookup condition.csv Department Name Role email employee_id
| where watch="Y"
| fields email employee_id
| eval Alert_date=relative_time(now(),"@m")
| append 
    [| inputlookup alerts.csv
    | where relative_time(now(),"@m")-Alert_sent_date &amp;lt; 60*7 OR employee_id = 0]
| stats max(*) as * by email employee_id
| eval _send_alert=if(isnull(Alert_sent_date), "Y",null())
| eval Alert_sent_date=if(_send_alert="Y", Alert_date,Alert_sent_date)
| eval Alert_updated_date=Alert_date
| rename Alert_date as _Alert_date
| outputlookup alerts.csv
| where isnotnull(_Alert_date)
| eval send_alert=if(_send_alert="Y",_send_alert,"N")
| fieldformat Alert_sent_date=strftime(Alert_sent_date,"%H:%M:%S")
| fieldformat Alert_updated_date=strftime(Alert_updated_date,"%H:%M:%S")&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The lines you would need to change for your case would be&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup audit.csv (replace with your search)

| eval Alert_date=relative_time(now(),"@d")
| append 
    [| inputlookup alerts.csv
    | where relative_time(now(),"@d")-Alert_sent_date &amp;lt; 60*60*24*7 OR employee_id = 0]&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;You might also want to filter the final result for send alert = Y so you only send an alert if any events are left.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 07:22:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560671#M159345</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-24T07:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560856#M159401</link>
      <description>&lt;P&gt;Hi ITWhsiper,&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&amp;nbsp; There is one missing piece in this.&amp;nbsp; Robert appears on Day1 and spunk sends an alert "Y".&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_0-1627332463242.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15244iB40714C6A781817C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_0-1627332463242.png" alt="longmen_0-1627332463242.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;He disappears on Day2&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_1-1627332545694.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15245iEADA70E176208ECC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_1-1627332545694.png" alt="longmen_1-1627332545694.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;He appears again on Day3 but Spunk does not send another alert.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_2-1627332609375.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15246iD9DCD82A40D2D348/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_2-1627332609375.png" alt="longmen_2-1627332609375.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What query do I need to add here so that Splunk will send an alert for Robert on Day 3? You used to give me this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval _send_alert=if(isnull(Alert_sent_date) OR Alert_date - Alert_sent_date &amp;gt; 60 * 2, "Y",null())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder how do I integrate it into this to make it work. Could you please advise?&lt;/P&gt;&lt;PRE&gt;| inputlookup audit.csv
| lookup condition.csv Department Name Role email employee_id
| where watch="Y"
| fields email employee_id
| eval Alert_date=relative_time(now(),"@m")
| append 
    [| inputlookup alerts.csv
    | where relative_time(now(),"@m")-Alert_sent_date &amp;lt; 60*7 OR employee_id = 0]
| stats max(*) as * by email employee_id
| eval _send_alert=if(isnull(Alert_sent_date), "Y",null())
| eval Alert_sent_date=if(_send_alert="Y", Alert_date,Alert_sent_date)
| eval Alert_updated_date=Alert_date
| rename Alert_date as _Alert_date
| outputlookup alerts.csv
| where isnotnull(_Alert_date)
| eval send_alert=if(_send_alert="Y",_send_alert,"N")
| fieldformat Alert_sent_date=strftime(Alert_sent_date,"%H:%M:%S")
| fieldformat Alert_updated_date=strftime(Alert_updated_date,"%H:%M:%S")&lt;/PRE&gt;&lt;P&gt;Very respectfully,&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 20:58:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560856#M159401</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-26T20:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560862#M159405</link>
      <description>&lt;P&gt;Try changing these two lines&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| outputlookup alerts.csv
| where isnotnull(_ALERT_DATE)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where isnotnull(_ALERT_DATE) OR EMPLOYEE_ID = 0
| outputlookup alerts.csv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 21:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560862#M159405</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-26T21:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560876#M159408</link>
      <description>&lt;P&gt;Hi ITWhisper,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not fixed and the error still persists. James , Robert John, Michael has "COUNTRY=CAN" and Splunk sends them alert on Day1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_0-1627338953463.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15247i94BB4683F75AC503/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_0-1627338953463.png" alt="longmen_0-1627338953463.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_1-1627339027803.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15248iB54DF97147086981/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_1-1627339027803.png" alt="longmen_1-1627339027803.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;James, William, David, and Richard are flagged on Day2 and Splunk only sends alert for William, David, and Richard. Splunk does not send an alert for James because his case is continuity.&amp;nbsp; That is perfect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_3-1627339128562.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15250i5761D394E9F3CFB9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_3-1627339128562.png" alt="longmen_3-1627339128562.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_4-1627339159647.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15251i7A028FE9A6666D97/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_4-1627339159647.png" alt="longmen_4-1627339159647.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;On Day3, James, Robert, Thomas, and Charles are flagged. Splunk did not send an alert for James (This is good because his case is continuity). Splunk sends an alert for Charles and Thomas (This is also good). However, Splunk does not send an alert for Robert (which is not good because Robert is flagged on Day1, he is not flagged on Day2 but he is flagged again on Day3. Hence, Splunk is supposed to send an alert to Robert).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_5-1627339203067.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15252i1277A0F32F6DA392/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_5-1627339203067.png" alt="longmen_5-1627339203067.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_6-1627339349287.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15253i4A32A34440CF3D75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_6-1627339349287.png" alt="longmen_6-1627339349287.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could you please help me fixing Robert's condition?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if I need to split this search, for example, one search is for continuity under 7 days and another search is for 24-hour break, just like Robert here, and combine both search somewhere? Please advise!&lt;/P&gt;&lt;P&gt;Very respectfully,&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 22:50:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560876#M159408</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-26T22:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560879#M159410</link>
      <description>&lt;P&gt;It looks like for Robert to still be in Day 2, the condition is still Y despite him changing country. Please can you share the contents of condition.csv?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 23:23:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560879#M159410</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-26T23:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560885#M159412</link>
      <description>&lt;P&gt;Hi ITWhisperer,&lt;/P&gt;&lt;P&gt;Thanks for your response, sir. Yes, I also noticed that Robert appears in Day2. Here is the content of the condition.csv file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_0-1627345788859.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15255iD853C08F787A715F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_0-1627345788859.png" alt="longmen_0-1627345788859.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_1-1627345825039.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15256i0D82848F6BDD77CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_1-1627345825039.png" alt="longmen_1-1627345825039.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Very respectfully,&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 00:31:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560885#M159412</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-27T00:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560889#M159413</link>
      <description>&lt;P&gt;Hi ITWhisperer,&lt;/P&gt;&lt;P&gt;Thanks for your response, sir. Yes, I also noticed that Robert appears in Day2. Here is the content of the condition.csv file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_0-1627346571545.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15257i6B844E2BA28B2988/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_0-1627346571545.png" alt="longmen_0-1627346571545.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_1-1627346596602.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15258iE75CB21C12011443/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_1-1627346596602.png" alt="longmen_1-1627346596602.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Very respectfully,&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 00:43:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560889#M159413</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-27T00:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560956#M159436</link>
      <description>&lt;P&gt;Can you move this line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ALERT_UPDATED_DATE=ALERT_DATE&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to above this line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rename ALERT_DATE as _ALERT_DATE​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so we can see whether the user is making it passed the first where command&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 08:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560956#M159436</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-27T08:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560967#M159437</link>
      <description>&lt;P&gt;It looks like the condition.csv mechanism isn't working for you.&lt;/P&gt;&lt;P&gt;Please try changing these lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields EMAIL EMPLOYEE_ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fields EMAIL EMPLOYEE_ID​ COUNTRY CONDITION&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;| rename ALERT_DATE as _ALERT_DATE&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rename ALERT_DATE as _ALERT_DATE COUNTRY as _COUNTRY CONDITION as _CONDITION​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and after&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval SEND_ALERT=if(_SEND_ALERT="Y",_SEND_ALERT,"N")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;add&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rename _COUNTRY as COUNTRY _CONDITION as CONDITION​​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 08:21:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560967#M159437</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-27T08:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560968#M159438</link>
      <description>&lt;P&gt;Also, which version of splunk are you using?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 08:08:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/560968#M159438</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-27T08:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561254#M163875</link>
      <description>&lt;P&gt;Hi&amp;nbsp; ITWhisperer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your responses. I am testing your logic on the paid Splunk virtual environment and Splunk still does not send another alert for the person on day3 when he is flagged and is sent an alert on Day1, disappear on Day2, and flagged again on Day3. I wonder if it works for you?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very respectfully,&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 20:06:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561254#M163875</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-28T20:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561269#M177562</link>
      <description>&lt;P&gt;It is working for me although I have slightly different commands to you. What I don't understand is why, for example, Robert appears in the results of the search on day 2. If as your output suggests his country is not CAN, he should have been removed by the first where command. If he has been removed, ALERT_DATE is not set when he is then added back in by the append inputlookup, which means he should have been removed (again) by the third where command. Can you rerun it with the changes I have suggested so we can see some more of the field values?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 22:30:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561269#M177562</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-28T22:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561399#M195314</link>
      <description>&lt;P&gt;Hi ITWhisperer,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your prompt response. I implemented your logic on Splunk 8.2.1. and Robert still pops up on Day2 even though he is not flagged on Day2 csv file.&amp;nbsp; Also, no alert was sent to Robert on Day3 as well even though he is flagged on Day3.&amp;nbsp;&lt;BR /&gt;Additionally, I implemented your logic on paid Splunk virtual environment and another dataset and I've got the same result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_0-1627572405773.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15311i1745CD1177491C6E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_0-1627572405773.png" alt="longmen_0-1627572405773.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_1-1627572475727.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15314i093D83E7C00BB683/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_1-1627572475727.png" alt="longmen_1-1627572475727.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_2-1627572524975.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15315i7E3883A8313B7751/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_2-1627572524975.png" alt="longmen_2-1627572524975.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_3-1627572565929.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15316i658B46E70F23AACE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_3-1627572565929.png" alt="longmen_3-1627572565929.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is how I set up condition.csv file&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_4-1627573024532.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15317i74C999AD76FEDA94/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_4-1627573024532.png" alt="longmen_4-1627573024532.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_5-1627573114979.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15318iD2451BA074AA6661/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_5-1627573114979.png" alt="longmen_5-1627573114979.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could you please advise?&lt;/P&gt;&lt;P&gt;Very respectfully,&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 15:39:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561399#M195314</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-29T15:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561401#M195316</link>
      <description>&lt;P&gt;What results do you get from just the first two line i.e. search + lookup?&lt;/P&gt;&lt;P&gt;(The results you have shown confirm that CONDITION is set to Y when we are not expecting it to be)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 15:50:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561401#M195316</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-29T15:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561402#M195317</link>
      <description>&lt;P&gt;I am presuming CONDITION doesn't exist after the first line i.e. just the search?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 15:52:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561402#M195317</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-29T15:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561406#M195318</link>
      <description>&lt;P&gt;I wonder if it is better for me to try working this on kv store instead? Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 16:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561406#M195318</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-29T16:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561454#M195326</link>
      <description>&lt;P&gt;OK I may have figured out what might be going on - the fields I was attempting to hide by renaming them with leading underscores are still getting written to the csv files, so try adding this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    | table ALERT_SENT_DATE ALERT_UPDATED_DATE EMAIL EMPLOYEE_ID&lt;/LI-CODE&gt;&lt;P&gt;after the inputlookup of alerts.csv&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 22:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561454#M195326</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-29T22:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561478#M195332</link>
      <description>&lt;P&gt;Hi ITWhisperer,&lt;/P&gt;&lt;P&gt;Thanks for always responding to my questions. It did not work. On day 2, Robert still appears. I believe your queries are supposed to overwrite the alerts.csv on Day1 and on Day2 there should be James, David, Richard, and William appearing on the alerts.csv file. However, this query lookups everyone and keep them in the alerts.csv file on day2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;On Day3, because the query also finds Robert on Day2 (which was supposed to be deleted), therefore, it is not sending another alert. In this case, Robert's case is just like James who appears for 3-day straight because Splunk does not overwrite the alerts.csv and delete Robert on Day2. Please advise and please let me know if I am wrong!&lt;/P&gt;&lt;P&gt;Very respectfully,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Long&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_2-1627613821787.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15332i4C479BF6B931CE70/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_2-1627613821787.png" alt="longmen_2-1627613821787.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_0-1627613212664.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15330iF0B221C1161ACF18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_0-1627613212664.png" alt="longmen_0-1627613212664.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="longmen_1-1627613251791.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/15331iAF6AF6FB534B0644/image-size/medium?v=v2&amp;amp;px=400" role="button" title="longmen_1-1627613251791.png" alt="longmen_1-1627613251791.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 02:57:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561478#M195332</guid>
      <dc:creator>longmen</dc:creator>
      <dc:date>2021-07-30T02:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: csv lookup for search query based on continuity and 7-day condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561505#M195342</link>
      <description>&lt;P&gt;What are the results of just the index search on day 2?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 07:35:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/csv-lookup-for-search-query-based-on-continuity-and-7-day/m-p/561505#M195342</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-30T07:35:23Z</dc:date>
    </item>
  </channel>
</rss>

