<?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: how to edit my search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311604#M160165</link>
    <description>&lt;P&gt;How about you add &lt;CODE&gt;| where CurrErrors&amp;gt;1&lt;/CODE&gt; in your search (at the end) itself and set the alert condition to &lt;CODE&gt;where number of results is greater than 0&lt;/CODE&gt;?&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jul 2017 19:47:49 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-07-12T19:47:49Z</dc:date>
    <item>
      <title>how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311603#M160164</link>
      <description>&lt;P&gt;earliest=-48h@h latest=-24h@h index="my-live-srv" sourcetype="Perfmon:sqlserver:sql_errors" counter="Errors/sec"| where instance="User Errors"  | stats avg(Value) as PrevErrors  | appendcols [ search earliest="-24h@h" latest="@h" index="my-live-srv" sourcetype="Perfmon:sqlserver:sql_errors" counter="Errors/sec" instance="User Errors" | stats avg(Value) as CurrErrors  ]|  eval PrevErrors=if(isnull(PrevErrors), 0, PrevErrors) | eval CurrErrors=if(isnull(CurrErrors), 0, CurrErrors) | eval CurrErrors=round(CurrErrors,3) |eval PrevErrors=round(PrevErrors,3) |eval CurrErrors=(CurrErrors + " Errors/sec") | eval PrevErrors=(PrevErrors + " Errors/sec") | appendcols [search earliest="-48h" latest="@h" index="my-live-srv" sourcetype="sql-trace" |where Date!="*$" | eval time_marker = if (_time &amp;lt; relative_time(now(), "-24h"), "yesterday", "today")| eval _time = if (time_marker=="yesterday", _time + 24*60*60, _time) ]| streamstats current=f window=1 global=f last(PrevErrors)  as PrevErrors | streamstats current=f window=1 global=f last(CurrErrors)  as CurrErrors|table  CurrErrors,PrevErrors,time_marker,Date,Time, ID, HostName, ClientProcessID, ApplicationName, LoginName, SPID, Severity, EventClass, State, Error, DatabaseName, EventSequence&lt;/P&gt;

&lt;P&gt;I want to save this as an alert but I want the alert to trigger only when CurrErrors &amp;gt;1. How can I do this ? I have tried with where condition  but  I dont have the expected result&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311603#M160164</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2020-09-29T14:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311604#M160165</link>
      <description>&lt;P&gt;How about you add &lt;CODE&gt;| where CurrErrors&amp;gt;1&lt;/CODE&gt; in your search (at the end) itself and set the alert condition to &lt;CODE&gt;where number of results is greater than 0&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 19:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311604#M160165</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-12T19:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311605#M160166</link>
      <description>&lt;P&gt;nope that doesn't work. I have tried&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 19:50:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311605#M160166</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-07-12T19:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311606#M160167</link>
      <description>&lt;P&gt;Got the issue. You're adding string text to CurrErrors making it a string and your where clause fails. Try adding this to your original search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| where tonumber(replace(CurrErrors,"^(\d+)\s.+","\1"))&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jul 2017 19:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311606#M160167</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-12T19:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311607#M160168</link>
      <description>&lt;P&gt;I tried now but no result again&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 19:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311607#M160168</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-07-12T19:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311608#M160169</link>
      <description>&lt;P&gt;| where CurrErrors &amp;lt; "1" &lt;BR /&gt;
I needed to enter this in the end of the search&lt;BR /&gt;
I found the solution, thank you for the help that CurrErrors was a string. This helped me a lot&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 20:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311608#M160169</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-07-12T20:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311609#M160170</link>
      <description>&lt;P&gt;Be sure to click &lt;CODE&gt;Accept&lt;/CODE&gt; to close the question.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 20:42:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311609#M160170</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-12T20:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311610#M160171</link>
      <description>&lt;P&gt;cant accept, the answer is as a comment&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 20:45:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311610#M160171</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-07-12T20:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to edit my search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311611#M160172</link>
      <description>&lt;P&gt;Now you can &lt;CODE&gt;Accept&lt;/CODE&gt;!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 21:10:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-edit-my-search/m-p/311611#M160172</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-12T21:10:23Z</dc:date>
    </item>
  </channel>
</rss>

