<?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: Configure an alert based on value of a dynamic field in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488514#M8659</link>
    <description>&lt;P&gt;Simply:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*event*" "Queue size for" field19&amp;gt;1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;fire alert,  &lt;CODE&gt;event count &amp;gt;0&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 19 Jan 2020 03:54:59 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-01-19T03:54:59Z</dc:date>
    <item>
      <title>Configure an alert based on value of a dynamic field</title>
      <link>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488510#M8655</link>
      <description>&lt;P&gt;One of our application logs prints the queue size for multiple users. Also, the same application is running on multiple hosts, the logs that we are indexing through contains queuesize info for multiple users across multiple hosts. Also, since the queuesize and user names are not standard values, I've re-named them within the query. &lt;/P&gt;

&lt;P&gt;The below search string lists the queuesize data according to the user and host. I wished to setup an alert only when the queuesize for any user on any node goes above 1000. I've tried using "where" clause but that does not work for some reason. Here is the sample query and the sample output -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*event*" AND "Queue size for" | stats first(field19) as QueueSize by field17, host |  rename field17 as User, field19 as QueueSize | sort -QueueSize, User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gives me this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Client  host    QueueSize
A         Server1   0;
A         Server2   0;
B         Server1   0;
B         Server2   0;
C         Server1   0;
C         Server2   0;
D         Server1   0;
D         Server2   0;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to be able to alert when the queuesize for any user on any server goes above 1000&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 14:20:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488510#M8655</guid>
      <dc:creator>vilashegde</dc:creator>
      <dc:date>2020-01-17T14:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Configure an alert based on value of a dynamic field</title>
      <link>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488511#M8656</link>
      <description>&lt;P&gt;You are trying to access a field that gets thrown away with &lt;CODE&gt;stats&lt;/CODE&gt; command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="event" AND "Queue size for" | stats first(field19) as QueueSize by field17, host | rename field17 as User, field19 as QueueSize | sort -QueueSize, User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After &lt;CODE&gt;stats&lt;/CODE&gt; the only fields available are QueueSize, field17, and host. So trying to use field19 gives you nothing for that field. Try removing &lt;CODE&gt;, field19 as QueueSize&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 15:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488511#M8656</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-01-17T15:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Configure an alert based on value of a dynamic field</title>
      <link>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488512#M8657</link>
      <description>&lt;P&gt;But that still does not help filter with the where clause.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 12:50:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488512#M8657</guid>
      <dc:creator>vilashegde</dc:creator>
      <dc:date>2020-01-18T12:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Configure an alert based on value of a dynamic field</title>
      <link>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488513#M8658</link>
      <description>&lt;P&gt;What you have should work just fine.  you can use either &lt;CODE&gt;search QueueSize &amp;gt; 1000&lt;/CODE&gt; or &lt;CODE&gt;where QueueSize &amp;gt; 1000&lt;/CODE&gt;;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo" AND host="*event*" AND "Queue size for"
| stats first(field19) AS QueueSize BY field17, host
| rename field17 AS User, field19 AS QueueSize
| sort 0 -QueueSize, User
| where QueueSize &amp;gt; 1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;NEVER use &lt;CODE&gt;sort&lt;/CODE&gt; without a number.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jan 2020 19:54:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488513#M8658</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-01-18T19:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Configure an alert based on value of a dynamic field</title>
      <link>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488514#M8659</link>
      <description>&lt;P&gt;Simply:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host="*event*" "Queue size for" field19&amp;gt;1000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;fire alert,  &lt;CODE&gt;event count &amp;gt;0&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jan 2020 03:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488514#M8659</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-19T03:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Configure an alert based on value of a dynamic field</title>
      <link>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488515#M8660</link>
      <description>&lt;P&gt;when I use the below search clause at the end, it is showing any positive value above 0.&lt;/P&gt;

&lt;P&gt;| search QueueSize &amp;gt; 1000&lt;/P&gt;

&lt;P&gt;Using | where QueueSize &amp;gt; 1000 at the end, is still not giving me the expected results.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 11:31:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Configure-an-alert-based-on-value-of-a-dynamic-field/m-p/488515#M8660</guid>
      <dc:creator>vilashegde</dc:creator>
      <dc:date>2020-01-22T11:31:45Z</dc:date>
    </item>
  </channel>
</rss>

