<?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: License Alert Custom Condition in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83010#M1148</link>
    <description>&lt;P&gt;I see you already found a solution yourself - accept that answer if you're satisfied to mark the question as resolved.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jan 2013 08:00:19 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2013-01-11T08:00:19Z</dc:date>
    <item>
      <title>License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83004#M1142</link>
      <description>&lt;P&gt;Am trying to monitor a license violation based on this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*license_usage.log type=Usage | eval MB=b/1024/1024 | stats sum(MB) as totalMB by pool, date_mday |where totalMB &amp;gt; 1000 |eval today=strftime(now(), "%e")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This returns the table as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;pool                        date_mday   totalMB        today
auto_generated_pool_enterprise  1   1509.784787  9
auto_generated_pool_enterprise  2   1775.701592  9
auto_generated_pool_enterprise  3   1860.892447  9
auto_generated_pool_enterprise  4   16658.177067     9
auto_generated_pool_enterprise  5   17781.991444     9
auto_generated_pool_enterprise  6   2208.284199  9
auto_generated_pool_enterprise  7   12906.510156     9
auto_generated_pool_enterprise  8   16878.486005     9
auto_generated_pool_enterprise  9   12402.581627     9
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now my issue is i want to set up an alert on the particular day when a license violation occurs and not on subsequent days. So am setting my custom alert condition as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search totalMB&amp;gt;1000 and (date_mday=" "+today or date_mday=today)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This does not work. How to write this custom condition?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 01:30:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83004#M1142</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2013-01-10T01:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83005#M1143</link>
      <description>&lt;P&gt;Am I right in assuming that you want to raise an alert when the indexed volume of the previous day (or the current day?) exceeds a certain amount?&lt;/P&gt;

&lt;P&gt;The easiest way to achieve that would be to filter the license usage events down to the relevant time frame straight away in the first search / the time picker. Then you have no issue filtering out the irrelevant days further down the query.&lt;/P&gt;

&lt;P&gt;The alert condition would then just check if there is a result for the day in question that passed the &amp;gt;1000MB filter.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 07:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83005#M1143</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-01-10T07:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83006#M1144</link>
      <description>&lt;P&gt;First, you don't need to have &lt;CODE&gt;search totalMB&amp;gt;1000&lt;/CODE&gt; in the alert condition, since the original search already does that.&lt;/P&gt;

&lt;P&gt;Second, 'or' should be 'OR'. 'and' should be 'AND'. There is a difference. However 'AND' is not needed, since there's an implicit AND between all search terms. Remove it. &lt;/P&gt;

&lt;P&gt;Third, I do not understand &lt;CODE&gt;date_mday=" "+today&lt;/CODE&gt;. What does that mean? Typo?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 07:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83006#M1144</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-01-10T07:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83007#M1145</link>
      <description>&lt;P&gt;well the answer  to your third question is because %d gives today as 09 and %e gives today as " 9". While date_mday gives as just 9. In order to compare i need to add the space when i have single digit day. Is there a way to concatenate?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 16:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83007#M1145</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2013-01-10T16:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83008#M1146</link>
      <description>&lt;P&gt;You are right but the issue is when the alert get triggered I want it to show all violations within that month. So am setting @mon to now as time frame. Again when I do this, it would just trigger everyday cause it would find that condition in the search result even if it is of a previous day. I want it to send me an email only when there is an alert today and show me how many violations in this month.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2013 18:39:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83008#M1146</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2013-01-10T18:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83009#M1147</link>
      <description>&lt;P&gt;Just answering my own question:&lt;BR /&gt;
The query would be:&lt;BR /&gt;
index=_internal source=*license_usage.log type=Usage | eval MB=b/1024/1024 | stats sum(MB) as TotalMBUsed by pool, date_mday|eval Today=trim((strftime(now(), "%e")), " ")| eval MBExceededBy = 512000 - TotalMBUsed |eval MBAvailable = 512000 |eval Environment = "DEV" |eval TriggeredOn = if((match(date_mday,Today)), "Today", date_mday)|where TotalMBUsed &amp;gt; 512000&lt;/P&gt;

&lt;P&gt;Time Range is @mon to now&lt;/P&gt;

&lt;P&gt;Custom Condtion is "search TriggeredOn = Today"&lt;/P&gt;

&lt;P&gt;This would trigger the alert on the day a violation occurs and the alert table will have all the violation of that month so that you know how many violations you have done in this month.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:05:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83009#M1147</guid>
      <dc:creator>pdash</dc:creator>
      <dc:date>2020-09-28T13:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83010#M1148</link>
      <description>&lt;P&gt;I see you already found a solution yourself - accept that answer if you're satisfied to mark the question as resolved.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 08:00:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83010#M1148</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-01-11T08:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: License Alert Custom Condition</title>
      <link>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83011#M1149</link>
      <description>&lt;P&gt;aah, yes, to concatenate use the dot operator &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval aa = " " . date_mday&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 08:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/License-Alert-Custom-Condition/m-p/83011#M1149</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-01-11T08:01:45Z</dc:date>
    </item>
  </channel>
</rss>

