<?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: Filter timeline results by items that had a change of more than 50% in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700262#M237651</link>
    <description>&lt;P&gt;Hello Yuanliu,&lt;BR /&gt;Thanks so much for your suggestion. This is getting close. I did have to change the first "span=1s" to something greater than 1m in order to get any results. Most likely because the "Query" total (and other DNS stats) are only logged once every 5 minutes with the totals for the past five minutes.&lt;BR /&gt;As you mentioned this does not give the connection points in the graph so I had a thought; what if I use this query to generate a list of sites to use in my original query. Something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=metrics host=*
| rex field=host "^(?&amp;lt;host&amp;gt;[\w\d-]+)\."
| lookup dns.csv sd_hostname AS host
| search Site IN (*)
| bin _time span=5m
| stats values(Query) as QPS by Site _time
| bin _time span=5m
| stats avg(QPS) as QPS by Site _time
| streamstats window=2 global=false current=true stdev(QPS) as devF by Site
| sort Site, - _time
| streamstats window=2 global=false current=true stdev(QPS) as devB by Site
| where 4*devF &amp;gt; QPS OR devB*4 &amp;gt; QPS
| table Site | dedup Site | mvcombine Site delim=","
| nomv Site&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives a CSV list of sites to search:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;FONT face="courier new,courier"&gt;Site&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;austx.1,snavtx.1&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Dashboard Studio and I'm trying to figure out how to chain these results as a variable in my original search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| search Site IN ($my-csv-list-from-above$)
...+&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;but so far I have not figured that out. Let me know if you have suggestions.&amp;nbsp; Thanks again for your help!&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2024 18:49:25 GMT</pubDate>
    <dc:creator>hellige</dc:creator>
    <dc:date>2024-09-26T18:49:25Z</dc:date>
    <item>
      <title>Filter timeline results by items that had a change of more than 50%</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700033#M237578</link>
      <description>&lt;P&gt;I have a basic timechart query that graphs the number of Queries per second (QPS) for several hosts. I need to filter the results to only show hosts that had a change in QPS of + or - 50% at any point.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image_2024-09-24_152058768.png" style="width: 333px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32796i3A773EB14A117ACC/image-size/large?v=v2&amp;amp;px=999" role="button" title="image_2024-09-24_152058768.png" alt="image_2024-09-24_152058768.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image_2024-09-24_152131594.png" style="width: 304px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32797iACEFE0179B07A2E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="image_2024-09-24_152131594.png" alt="image_2024-09-24_152131594.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(Show only these two results and drop the others)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;index=metrics host=*&lt;BR /&gt;| timechart span=5m partial=f limit=0 per_second(Query) as QPS by Site&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 21:26:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700033#M237578</guid>
      <dc:creator>hellige</dc:creator>
      <dc:date>2024-09-24T21:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter timeline results by items that had a change of more than 50%</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700051#M237585</link>
      <description>&lt;P&gt;Maybe something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mstats rate(Query) as QPS where index=metrics host=* by Site span=5m
| streamstats window=2 global=false current=false stdev(QPS) as devF by Site
| sort Site, - _time
| streamstats window=2 global=false current=false stdev(QPS) as devB by Site
| where 4*devF &amp;gt; QPS OR 4*devB &amp;gt; QPS
| timechart span=5m values(QPS) by Site&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 06:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700051#M237585</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-09-25T06:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Filter timeline results by items that had a change of more than 50%</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700119#M237604</link>
      <description>&lt;P&gt;Thanks for the idea. Unfortunately that's not going to work. I have to use a lookup table to get the Site and mstat insists on being the first command in the query.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=metrics host=*
| rex field=host "^(?&amp;lt;host&amp;gt;[\w\d-]+)\."
| lookup dns.csv sd_hostname AS host
| timechart span=5m partial=f limit=0 per_second(Query) as QPS by Site&lt;/LI-CODE&gt;
&lt;P&gt;I also tried using mstat BY host but that did not return any results.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 22:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700119#M237604</guid>
      <dc:creator>hellige</dc:creator>
      <dc:date>2024-09-25T22:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter timeline results by items that had a change of more than 50%</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700150#M237621</link>
      <description>&lt;P&gt;Based on your search, I believe that index metrics is not a metrics index, but an event index. &amp;nbsp;Is this correct? &amp;nbsp;The fundamental idea to meet your idea is to not use timechart before we can detect change. &amp;nbsp;Here is an alternative if you have to use index search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=metrics host=*
| rex field=host "^(?&amp;lt;host&amp;gt;[\w\d-]+)\."
| lookup dns.csv sd_hostname AS host
| bin _time span=1s
| stats rate(Query) as QPS by Site _time
| bin _time span=5m
| stats avg(QPS) as QPS by Site _time
| streamstats window=2 global=false current=true stdev(QPS) as devF by Site
| sort Site, - _time
| streamstats window=2 global=false current=true stdev(QPS) as devB by Site
| where 4*devF &amp;gt; QPS OR 4*devB &amp;gt; QPS
| timechart span=5m values(QPS) by Site&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get to this step, I have to run timebucket twice to get 5-min average of QPS. (When you run per_second in timechart span=5m, I suspect it gives you an average of sorts.)&lt;/P&gt;&lt;P&gt;I ran this against an emulation that you can also run,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index = _audit earliest=-0d@d latest=-0d@d+1h
| rename action as Site
| streamstats count as Query by Site
``` the above emulates
index=metrics host=*
| rex field=host "^(?&amp;lt;host&amp;gt;[\w\d-]+)\."
| lookup dns.csv sd_hostname AS host
```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The caveat is that if a Site has no query in some 5-minute intervals then have a significant change later, you won't get connected points on the graph.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 23:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700150#M237621</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-09-25T23:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter timeline results by items that had a change of more than 50%</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700262#M237651</link>
      <description>&lt;P&gt;Hello Yuanliu,&lt;BR /&gt;Thanks so much for your suggestion. This is getting close. I did have to change the first "span=1s" to something greater than 1m in order to get any results. Most likely because the "Query" total (and other DNS stats) are only logged once every 5 minutes with the totals for the past five minutes.&lt;BR /&gt;As you mentioned this does not give the connection points in the graph so I had a thought; what if I use this query to generate a list of sites to use in my original query. Something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=metrics host=*
| rex field=host "^(?&amp;lt;host&amp;gt;[\w\d-]+)\."
| lookup dns.csv sd_hostname AS host
| search Site IN (*)
| bin _time span=5m
| stats values(Query) as QPS by Site _time
| bin _time span=5m
| stats avg(QPS) as QPS by Site _time
| streamstats window=2 global=false current=true stdev(QPS) as devF by Site
| sort Site, - _time
| streamstats window=2 global=false current=true stdev(QPS) as devB by Site
| where 4*devF &amp;gt; QPS OR devB*4 &amp;gt; QPS
| table Site | dedup Site | mvcombine Site delim=","
| nomv Site&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gives a CSV list of sites to search:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;FONT face="courier new,courier"&gt;Site&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;austx.1,snavtx.1&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Dashboard Studio and I'm trying to figure out how to chain these results as a variable in my original search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| search Site IN ($my-csv-list-from-above$)
...+&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;but so far I have not figured that out. Let me know if you have suggestions.&amp;nbsp; Thanks again for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 18:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-timeline-results-by-items-that-had-a-change-of-more-than/m-p/700262#M237651</guid>
      <dc:creator>hellige</dc:creator>
      <dc:date>2024-09-26T18:49:25Z</dc:date>
    </item>
  </channel>
</rss>

