<?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 How to condition an alert for a chart? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604156#M13996</link>
    <description>&lt;P&gt;good morning community&lt;/P&gt;
&lt;P&gt;I want to generate an alert in splunk based on some graphs that are generated from a .TXT file, therefore I only need to use the last two values generated in said file to apply a formula if said value drops 10% of its measurement.&lt;/P&gt;
&lt;P&gt;When I query the TXT file which displays a list as follows in the events:&lt;/P&gt;
&lt;P&gt;2022-7-1 11:00:0 OVERALL: 10000&lt;BR /&gt;2022-7-1 12:00:0 OVERALL: 11000&lt;/P&gt;
&lt;P&gt;I just need to get the last numeric value and the penultimate numeric value registered in the list and add them to a variable to apply the formula of comparing these two values to see if there is a difference of more than 10%.&lt;/P&gt;
&lt;P&gt;Please, if you have had a similar case, please share the solution.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jul 2022 21:03:20 GMT</pubDate>
    <dc:creator>dummy_splunk</dc:creator>
    <dc:date>2022-07-01T21:03:20Z</dc:date>
    <item>
      <title>How to condition an alert for a chart?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604156#M13996</link>
      <description>&lt;P&gt;good morning community&lt;/P&gt;
&lt;P&gt;I want to generate an alert in splunk based on some graphs that are generated from a .TXT file, therefore I only need to use the last two values generated in said file to apply a formula if said value drops 10% of its measurement.&lt;/P&gt;
&lt;P&gt;When I query the TXT file which displays a list as follows in the events:&lt;/P&gt;
&lt;P&gt;2022-7-1 11:00:0 OVERALL: 10000&lt;BR /&gt;2022-7-1 12:00:0 OVERALL: 11000&lt;/P&gt;
&lt;P&gt;I just need to get the last numeric value and the penultimate numeric value registered in the list and add them to a variable to apply the formula of comparing these two values to see if there is a difference of more than 10%.&lt;/P&gt;
&lt;P&gt;Please, if you have had a similar case, please share the solution.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 21:03:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604156#M13996</guid>
      <dc:creator>dummy_splunk</dc:creator>
      <dc:date>2022-07-01T21:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: condition an alert for a chart</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604161#M13997</link>
      <description>&lt;P&gt;Honestly I have no idea how you would want to execute a search over a text file. You have to onboard the data from the file into splunk first either as events or as lookup contents. Then you could relatively easily search for such condition.&lt;/P&gt;&lt;P&gt;You could of course create a custom command to manipulate text files but then you really don't need Splunk in the first place.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 18:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604161#M13997</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-01T18:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: condition an alert for a chart</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604171#M13998</link>
      <description>&lt;P&gt;hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp; I perform the following search:&lt;/P&gt;&lt;P&gt;index = "monitor" source="/monitor/recolector.txt" | timechart values(valor) as recolector span=1h&lt;/P&gt;&lt;P&gt;Result:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;2022-7-1&lt;/SPAN&gt; &lt;SPAN class=""&gt;11:19:0&lt;/SPAN&gt; &lt;SPAN class=""&gt;GLOBAN:&lt;/SPAN&gt; &lt;FONT color="#FF0000"&gt;&lt;SPAN class=""&gt;15000&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;2022-7-1&lt;/SPAN&gt; &lt;SPAN class=""&gt;11:29:0&lt;/SPAN&gt; &lt;SPAN class=""&gt;GLOBAN:&lt;/SPAN&gt; &lt;FONT color="#FF0000"&gt;&lt;SPAN class=""&gt;15200&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;2022-7-1&lt;/SPAN&gt; &lt;SPAN class=""&gt;11:39:0&lt;/SPAN&gt; &lt;SPAN class=""&gt;GLOBAN:&lt;/SPAN&gt; &lt;FONT color="#FF0000"&gt;16200&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.............................................&lt;/P&gt;&lt;P&gt;From that result I generate a graph and therefore I want to take the last two measurements as values to be able to compare if there was a loss in the values by more than 10%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any suggestion?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 19:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604171#M13998</guid>
      <dc:creator>dummy_splunk</dc:creator>
      <dc:date>2022-07-01T19:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: condition an alert for a chart</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604173#M13999</link>
      <description>&lt;P&gt;Well, timechart doesn't usually go well with values(). If you have a value for about every hour and just want to snap timestamps to full hour you can simply do&lt;/P&gt;&lt;PRE&gt;| bin _time span=1h&lt;/PRE&gt;&lt;P&gt;Instead of your timechart.&lt;/P&gt;&lt;P&gt;Now get last two values&lt;/P&gt;&lt;PRE&gt;| tail 2&lt;/PRE&gt;&lt;P&gt;Get just your field (your output doesn't match your search; I'll assume it's called recollector)&lt;/P&gt;&lt;PRE&gt;| fields recollector&lt;/PRE&gt;&lt;P&gt;Transpose it so you have both values in single row&lt;/P&gt;&lt;PRE&gt;| transpose&lt;/PRE&gt;&lt;P&gt;Now you have two fields in&amp;nbsp; your result row called 'row 1' and 'row 2'. You can easily verify if the difference is more than 10% using where&lt;/P&gt;&lt;PRE&gt;| where 'row 2'&amp;lt;'row 1'*0.9&lt;/PRE&gt;&lt;P&gt;et volia&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 20:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604173#M13999</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-01T20:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: condition an alert for a chart</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604193#M14000</link>
      <description>&lt;P&gt;thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt; I tried with the suggestion you make me but I get to this point with the following result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dummy_splunk_0-1656712116750.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20371i6478FA97B24E5E35/image-size/large?v=v2&amp;amp;px=999" role="button" title="dummy_splunk_0-1656712116750.png" alt="dummy_splunk_0-1656712116750.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and I want to make the comparison with the numeric values of the &lt;STRONG&gt;_raw&lt;/STRONG&gt; column to apply the where&lt;/P&gt;&lt;P&gt;how could i do it?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 21:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604193#M14000</guid>
      <dc:creator>dummy_splunk</dc:creator>
      <dc:date>2022-07-01T21:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: condition an alert for a chart</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604194#M14001</link>
      <description>&lt;P&gt;You're doing something strange before. _indextime is not a field I'd expect to see.&lt;/P&gt;&lt;P&gt;But anyway, you need to parse out the nummerical value only from the field using rex&lt;/P&gt;&lt;PRE&gt;| rex field=recolector "GLOBAL_DIARIO:\s*(?&amp;lt;recollector&amp;gt;\d+)"&lt;/PRE&gt;&lt;P&gt;Put it right after your initial search.&lt;/P&gt;&lt;P&gt;And do&lt;/P&gt;&lt;PRE&gt;| fields - _*&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jul 2022 21:57:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604194#M14001</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-07-01T21:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: condition an alert for a chart</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604200#M14002</link>
      <description>&lt;P&gt;perfect &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt; I tried again with the suggestion you make me but I get to this point:&lt;/P&gt;&lt;P&gt;The only result that should be reflected is the "valor" field to perform the where, because if I apply it with those other columns, it takes them into consideration for the condition.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dummy_splunk_0-1656714655865.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20372iAACB353F9F524714/image-size/large?v=v2&amp;amp;px=999" role="button" title="dummy_splunk_0-1656714655865.png" alt="dummy_splunk_0-1656714655865.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How could I omit the other fields and only the result is "valor"&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 22:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604200#M14002</guid>
      <dc:creator>dummy_splunk</dc:creator>
      <dc:date>2022-07-01T22:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: condition an alert for a chart</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604350#M14003</link>
      <description>&lt;P&gt;Good afternoon &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt; with this query I managed to obtain the values I needed&lt;/P&gt;&lt;P&gt;index = "monitor" source="monitor/recolector.txt" | timechart values(valor) as metrica span=1h | where metrica&amp;gt;1 | tail 2 | transpose&lt;/P&gt;&lt;P&gt;Thanks for your collaboration, I just have to add the conditions to complete &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2022 16:27:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-condition-an-alert-for-a-chart/m-p/604350#M14003</guid>
      <dc:creator>dummy_splunk</dc:creator>
      <dc:date>2022-07-04T16:27:57Z</dc:date>
    </item>
  </channel>
</rss>

