<?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: Alert for filename with previous date in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535395#M10100</link>
    <description>&lt;P&gt;Thank you! Will try this out&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2021 19:56:47 GMT</pubDate>
    <dc:creator>vm_molson</dc:creator>
    <dc:date>2021-01-11T19:56:47Z</dc:date>
    <item>
      <title>Alert for filename with previous date</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/534970#M10090</link>
      <description>&lt;P&gt;I would like to write an alert that runs Tuesday through Saturday, and looks for files that have been dropped off on our FTP server with the previous day in the filename and fires when four of those files have been found.&lt;/P&gt;&lt;P&gt;Example, on &lt;STRONG&gt;1/6/2021&lt;/STRONG&gt;, I want my alert to tell me when 4 files have been delivered matching a filename of &lt;STRONG&gt;xxx_20210105_yyy&lt;/STRONG&gt; (where &lt;STRONG&gt;&lt;EM&gt;xxx_&lt;/EM&gt;&lt;/STRONG&gt; and &lt;STRONG&gt;&lt;EM&gt;_yyy&lt;/EM&gt;&amp;nbsp;&lt;/STRONG&gt;can be anything). Those files are typically delivered in the morning hours, but possibly have come in as early as 11:30 PM the night before.&lt;/P&gt;&lt;P&gt;What is the best way to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 16:05:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/534970#M10090</guid>
      <dc:creator>vm_molson</dc:creator>
      <dc:date>2021-01-06T16:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Alert for filename with previous date</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535087#M10091</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/43646"&gt;@vm_molson&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use below query to filter events that matches your criteria, schedule the alert like every 5 minutes and set alert condition as result count more than 3.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| your search that has "filename" field contains ftp filenames
| eval yesterday=now()-86400 
| eval yesterday=strftime(yesterday,"%Y%m%d")
| where LIKE (filename, "%_".'yesterday'."_%")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 17:48:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535087#M10091</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-07T17:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Alert for filename with previous date</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535395#M10100</link>
      <description>&lt;P&gt;Thank you! Will try this out&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 19:56:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535395#M10100</guid>
      <dc:creator>vm_molson</dc:creator>
      <dc:date>2021-01-11T19:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Alert for filename with previous date</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535905#M10119</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;... thank you for the tip! It seems to work pretty well, but 3 out of the 4 filenames are like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;blahblahblah&lt;FONT color="#FF0000"&gt;_&lt;/FONT&gt;DATE&lt;FONT color="#FF0000"&gt;_&lt;/FONT&gt;blahblahblah&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;.. and only one of the filenames is like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;blahblahblah&lt;FONT color="#FF0000"&gt;.&lt;/FONT&gt;DATE&lt;FONT color="#FF0000"&gt;.&lt;/FONT&gt;blahblahblah&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The exact syntax you suggested works to get the file with the periods in the filename, but not with the underscores. I've tried various permutations and I know I am missing something.. but any thoughts about how I might get the others as well?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 20:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535905#M10119</guid>
      <dc:creator>vm_molson</dc:creator>
      <dc:date>2021-01-14T20:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Alert for filename with previous date</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535915#M10120</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/43646"&gt;@vm_molson&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;In fact it should have been work with only underscores but you can try below two options;&lt;/P&gt;&lt;P&gt;Only &lt;STRONG&gt;blahblahblah_DATE_blahblahblah&lt;/STRONG&gt; OR &lt;STRONG&gt;blahblahblah.DATE.blahblahblah&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval yesterday=now()-86400 
| eval yesterday=strftime(yesterday,"%Y%m%d")
| where match(filename, "[_\.]".'yesterday'."[_\.]")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Any separator before and after DATE&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval yesterday=now()-86400 
| eval yesterday=strftime(yesterday,"%Y%m%d")
| where match(filename, "\w+.".'yesterday'.".\w+")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 21:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/535915#M10120</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-14T21:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Alert for filename with previous date</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/537452#M10174</link>
      <description>&lt;P&gt;Appreciate you sticking with me,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;! I actually am still not able to make it work. Let me specify the exact file names I should be getting... maybe I missed something in my explanation? Maybe it is that there is no character directly after the date on three of them? I had assumed a space would count as any character, but I'm not as up on my RegEx as I should be.&lt;/P&gt;&lt;P&gt;The log entries look like:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t h"&gt;...created&lt;/SPAN&gt; &lt;SPAN class="t"&gt;/Companyname_POS_20210126&lt;/SPAN&gt; &lt;SPAN class="t"&gt;-&lt;/SPAN&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;...created /Companyname_TRN_20210126 -&amp;nbsp;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;...created /Companyname_TRD_20210126 - ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;...created /&lt;SPAN class="t a"&gt;COMPANYIDTAXLOT&lt;/SPAN&gt;.20210126.230053 -&amp;nbsp;...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 16:56:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/537452#M10174</guid>
      <dc:creator>vm_molson</dc:creator>
      <dc:date>2021-01-27T16:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alert for filename with previous date</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/537488#M10175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/43646"&gt;@vm_molson&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;For sure the problem is because of space. In regex, all options should be defined specifically in order to lower false positive matches. Based on your sample events below should work;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval yesterday=now()-86400 
| eval yesterday=strftime(yesterday,"%Y%m%d")
| where match(filename, "[_\.]".'yesterday'."[_\.\s]")&lt;/LI-CODE&gt;&lt;P&gt;Or if you sure there is no other date in the file you can use below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval yesterday=now()-86400 
| eval yesterday=strftime(yesterday,"%Y%m%d")
| where match(filename, ".+".'yesterday'.".+")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 19:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-for-filename-with-previous-date/m-p/537488#M10175</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-27T19:24:22Z</dc:date>
    </item>
  </channel>
</rss>

