<?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: Regarding Splunk custom alert in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599278#M13881</link>
    <description>&lt;P&gt;I am not suggesting you remove that where command, I am suggesting you replace the chart with an eventstats and another where command&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 12:21:01 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-05-25T12:21:01Z</dc:date>
    <item>
      <title>How to configure Splunk custom alert?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599227#M13878</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am configuring a custom splunk alert. My search query is as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| dbxquery connection="FFconed_feTenant" query="select count(file_name) as file_count, DATE_FORMAT(created_at,\"%m/%d/%y %W\") as date from ida_files_inventory
where created_at &amp;gt; Date_sub(Curdate(), INTERVAL 30 Day) and created_at &amp;lt; Curdate() group by DATE_FORMAT(created_at,\"%m/%d/%y %W\")" | fields file_count,date |where file_count&amp;lt;100 | chart
avg(file_count) as avg_count&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to send an alert when the file_count is less than 0.95*avg_count or greater than 1.5*avg_count&lt;BR /&gt;So can I configure a custom alert with condition "search file_count &amp;lt; (0.95*avg_count) OR&amp;nbsp;file_count &amp;gt; (1.5*avg_count)"&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 18:31:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599227#M13878</guid>
      <dc:creator>devdattajogleka</dc:creator>
      <dc:date>2022-05-25T18:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Splunk custom alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599231#M13879</link>
      <description>&lt;P&gt;Use eventstats rather than chart to get the average in each event and then use a where command to find the events which are outside the bounds&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 07:36:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599231#M13879</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-25T07:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Splunk custom alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599241#M13880</link>
      <description>&lt;P&gt;Actually I want to take average of all 'file_count's which are less than 100. Thats why I have applied where condition first.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 09:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599241#M13880</guid>
      <dc:creator>devdattajogleka</dc:creator>
      <dc:date>2022-05-25T09:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Splunk custom alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599278#M13881</link>
      <description>&lt;P&gt;I am not suggesting you remove that where command, I am suggesting you replace the chart with an eventstats and another where command&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 12:21:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599278#M13881</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-25T12:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Splunk custom alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599444#M13885</link>
      <description>&lt;P&gt;Yeah got that. Alert is working. Thank you so much.&lt;/P&gt;&lt;P&gt;I want to add one more condition to it. The alert should the include the file_count's of last week only. I used following query for that.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| dbxquery connection="FFconed_feTenant" query="select count(file_name) as file_count, DATE_FORMAT(created_at,\"%m/%d/%y %W\") as date from ida_files_inventory&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where created_at &amp;gt; Date_sub(Curdate(), INTERVAL 30 Day) and created_at &amp;lt; Curdate() group by DATE_FORMAT(created_at,\"%m/%d/%y %W\")" | fields file_count,date | where file_count&amp;lt;100 | eventstats&amp;nbsp; avg(file_count) as avg_count | where file_count &amp;lt; (avg_count*0.875) or file_count &amp;gt; (avg_count*1.125) | fields file_count,date | where date &amp;gt; relative_time(now(), "-7d@d")&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Used "-w" instead of&amp;nbsp;&amp;nbsp;&lt;FONT color="#000000"&gt;&lt;A href="mailto:-7d@d" target="_blank"&gt;"-7d@d&lt;/A&gt;"&lt;/FONT&gt; Also tried using strftime by specifying date format, using 'earliest' time modifier but the query does not yeild any result whereas it should. Please suggest a solution.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2022 13:40:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599444#M13885</guid>
      <dc:creator>devdattajogleka</dc:creator>
      <dc:date>2022-05-26T13:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding Splunk custom alert</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599475#M13886</link>
      <description>&lt;P&gt;I suspect date is coming back as a string from dbxquery, therefore you need to parse that into an epoch time so you can compare it with the value returned by relative_time() - try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where strptime(date,"%m/%d/%y %W") &amp;gt; relative_time(now(), "-7d@d")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 May 2022 18:05:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-configure-Splunk-custom-alert/m-p/599475#M13886</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-26T18:05:30Z</dc:date>
    </item>
  </channel>
</rss>

