<?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: searching events for &amp;quot;was down for&amp;quot; and averaging the time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/searching-events-for-quot-was-down-for-quot-and-averaging-the/m-p/677829#M231776</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263723"&gt;@jyates76&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to extract the down duratio and then run a simple search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index "was down for"
| rex "was\s+down\s+for\s+(?&amp;lt;hours&amp;gt;\d+)hr:(?&amp;lt;minutes&amp;gt;\d+)min:(?&amp;lt;seconds&amp;gt;\d+)sec"
| eval duration=hours*3600+minutes*60+seconds
| timechart perc90(duration) BY host&lt;/LI-CODE&gt;&lt;P&gt;You can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/75pRcf/1" target="_blank"&gt;https://regex101.com/r/75pRcf/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then you can use other functions or aggregations.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 16 Feb 2024 17:16:19 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-02-16T17:16:19Z</dc:date>
    <item>
      <title>searching events for "was down for" and averaging the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/searching-events-for-quot-was-down-for-quot-and-averaging-the/m-p/677795#M231765</link>
      <description>&lt;P&gt;I have events like the below that are saying when a particular pool member was out of rotation for a particular period of time.&amp;nbsp; What would be an ideal search would be to match all events that have the "was down for" and then the length of time and simply average that, and take the 95th percentile of that duration.&amp;nbsp; &amp;nbsp;Probably more difficult than it seems and I'm not sure how to approach it.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;lt;&lt;SPAN class=""&gt;133&lt;/SPAN&gt;&amp;gt;&lt;SPAN class=""&gt;Feb&lt;/SPAN&gt; &lt;SPAN class=""&gt;13&lt;/SPAN&gt; &lt;SPAN class=""&gt;13:01:33&lt;/SPAN&gt; &lt;SPAN class=""&gt;slot2/US66666-CORE-LTM1.company.COM&lt;/SPAN&gt; &lt;SPAN class=""&gt;notice&lt;/SPAN&gt; &lt;SPAN class=""&gt;mcpd&lt;/SPAN&gt;[&lt;SPAN class=""&gt;8701&lt;/SPAN&gt;]&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;01070727:5:&lt;/SPAN&gt; &lt;SPAN class=""&gt;Pool&lt;/SPAN&gt; &lt;SPAN class=""&gt;/Common/pool-generic&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;member&lt;/SPAN&gt; &lt;SPAN class=""&gt;/Common/servernamew006:8080&lt;/SPAN&gt; &lt;SPAN class=""&gt;monitor&lt;/SPAN&gt; &lt;SPAN class=""&gt;status&lt;/SPAN&gt; &lt;SPAN class=""&gt;up.&lt;/SPAN&gt; [ &lt;SPAN class=""&gt;/Common/mon-xxx-prod-xxx-liveness:&lt;/SPAN&gt; &lt;SPAN class=""&gt;up&lt;/SPAN&gt; ] &lt;STRONG&gt;[ &lt;SPAN class=""&gt;was&lt;/SPAN&gt; &lt;SPAN class=""&gt;down&lt;/SPAN&gt; &lt;SPAN class=""&gt;for&lt;/SPAN&gt; &lt;SPAN class=""&gt;0hr:0min:15sec&lt;/SPAN&gt; ]&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;UL class=""&gt;&lt;LI&gt;&lt;SPAN class=""&gt;host =&lt;/SPAN&gt;&lt;SPAN&gt; &lt;SPAN class=""&gt;&lt;A class="" title="/var/log/HOSTS/us6645ny-core-ltm1.paychex.com/us6645ny-core-ltm1.paychex.com-syslog.log" href="https://splunk.paychex.com/en-US/app/SHO/search?earliest=1707843600.000&amp;amp;latest=1707847200&amp;amp;q=search%20index%3Df5_prod%20Monitor_Status%3D%22monitor%20status%20up%22%20f5_pool_member%20IN%20(*caappr*ui*%2C%20*caappr*bt*%2C%20*caappr*rp*)%20f5_pool_monitor%20IN%20(%2FCommon%2Fmon-pay*-prod-wdc-liveness%2C%20%2FCommon%2Fmon-pay*-prod-hdc-liveness)%20%20%20%20%7C%20rex%20field%3D_raw%20%22%3E(%3F%3Calert_time%3E.%2B)%20slot%22%20%20%20%20%20%7C%20eval%20_time%3Dstrptime(alert_time%2C%20%22%25b%20%25d%20%25H%3A%25M%3A%25S%22)%20%20%20%20%20%7C%20eval%20date_hour%3Dstrftime(_time%2C%22%25H%22)%20%20%20%20%7C%20eval%20day_of_week%20%3D%20strftime(_time%2C%22%25A%22)%20%20%20%20%7C%20eval%20date_wday%20%3D%20strftime(_time%2C%20%22%25w%22)%20%20%20%20%7C%20sort%20-%20_time%20%20%20%7C%20search%20date_hour%3E%3D7%20date_hour%3C%3D17%20date_wday%3E%3D1%20date_wday%3C%3D5%20%20%20%20%7C%20rex%20field%3Df5_pool_monitor%20%22(%3F%3Cpaycluster%3Epay.%2B%5B0-9%5D).%2B(%3F%3Cdatacenter%3E%5Bhw%5Ddc)%22%20%20%20%20%7C%20search%20paycluster%3Dpay06%20%7C%20dedup%20_raw&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1708084649.2017262_28F65100-3C82-4CB7-8F25-B612CCC1B240#" target="_blank" rel="noopener"&gt;US66666&lt;/A&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="us6645ny-core-ltm1.paychex.com" href="https://splunk.paychex.com/en-US/app/SHO/search?earliest=1707843600.000&amp;amp;latest=1707847200&amp;amp;q=search%20index%3Df5_prod%20Monitor_Status%3D%22monitor%20status%20up%22%20f5_pool_member%20IN%20(*caappr*ui*%2C%20*caappr*bt*%2C%20*caappr*rp*)%20f5_pool_monitor%20IN%20(%2FCommon%2Fmon-pay*-prod-wdc-liveness%2C%20%2FCommon%2Fmon-pay*-prod-hdc-liveness)%20%20%20%20%7C%20rex%20field%3D_raw%20%22%3E(%3F%3Calert_time%3E.%2B)%20slot%22%20%20%20%20%20%7C%20eval%20_time%3Dstrptime(alert_time%2C%20%22%25b%20%25d%20%25H%3A%25M%3A%25S%22)%20%20%20%20%20%7C%20eval%20date_hour%3Dstrftime(_time%2C%22%25H%22)%20%20%20%20%7C%20eval%20day_of_week%20%3D%20strftime(_time%2C%22%25A%22)%20%20%20%20%7C%20eval%20date_wday%20%3D%20strftime(_time%2C%20%22%25w%22)%20%20%20%20%7C%20sort%20-%20_time%20%20%20%7C%20search%20date_hour%3E%3D7%20date_hour%3C%3D17%20date_wday%3E%3D1%20date_wday%3C%3D5%20%20%20%20%7C%20rex%20field%3Df5_pool_monitor%20%22(%3F%3Cpaycluster%3Epay.%2B%5B0-9%5D).%2B(%3F%3Cdatacenter%3E%5Bhw%5Ddc)%22%20%20%20%20%7C%20search%20paycluster%3Dpay06%20%7C%20dedup%20_raw&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1708084649.2017262_28F65100-3C82-4CB7-8F25-B612CCC1B240#" target="_blank" rel="noopener"&gt;core-ltm1.company.com&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;source =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="/var/log/HOSTS/us6645ny-core-ltm1.paychex.com/us6645ny-core-ltm1.paychex.com-syslog.log" href="https://splunk.paychex.com/en-US/app/SHO/search?earliest=1707843600.000&amp;amp;latest=1707847200&amp;amp;q=search%20index%3Df5_prod%20Monitor_Status%3D%22monitor%20status%20up%22%20f5_pool_member%20IN%20(*caappr*ui*%2C%20*caappr*bt*%2C%20*caappr*rp*)%20f5_pool_monitor%20IN%20(%2FCommon%2Fmon-pay*-prod-wdc-liveness%2C%20%2FCommon%2Fmon-pay*-prod-hdc-liveness)%20%20%20%20%7C%20rex%20field%3D_raw%20%22%3E(%3F%3Calert_time%3E.%2B)%20slot%22%20%20%20%20%20%7C%20eval%20_time%3Dstrptime(alert_time%2C%20%22%25b%20%25d%20%25H%3A%25M%3A%25S%22)%20%20%20%20%20%7C%20eval%20date_hour%3Dstrftime(_time%2C%22%25H%22)%20%20%20%20%7C%20eval%20day_of_week%20%3D%20strftime(_time%2C%22%25A%22)%20%20%20%20%7C%20eval%20date_wday%20%3D%20strftime(_time%2C%20%22%25w%22)%20%20%20%20%7C%20sort%20-%20_time%20%20%20%7C%20search%20date_hour%3E%3D7%20date_hour%3C%3D17%20date_wday%3E%3D1%20date_wday%3C%3D5%20%20%20%20%7C%20rex%20field%3Df5_pool_monitor%20%22(%3F%3Cpaycluster%3Epay.%2B%5B0-9%5D).%2B(%3F%3Cdatacenter%3E%5Bhw%5Ddc)%22%20%20%20%20%7C%20search%20paycluster%3Dpay06%20%7C%20dedup%20_raw&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1708084649.2017262_28F65100-3C82-4CB7-8F25-B612CCC1B240#" target="_blank" rel="noopener"&gt;/var/log/HOSTS/US66666-core-ltm1.company.com/xxx.xxx.com-syslog.log&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;sourcetype =&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;A class="" title="syslog_alb" href="https://splunk.paychex.com/en-US/app/SHO/search?earliest=1707843600.000&amp;amp;latest=1707847200&amp;amp;q=search%20index%3Df5_prod%20Monitor_Status%3D%22monitor%20status%20up%22%20f5_pool_member%20IN%20(*caappr*ui*%2C%20*caappr*bt*%2C%20*caappr*rp*)%20f5_pool_monitor%20IN%20(%2FCommon%2Fmon-pay*-prod-wdc-liveness%2C%20%2FCommon%2Fmon-pay*-prod-hdc-liveness)%20%20%20%20%7C%20rex%20field%3D_raw%20%22%3E(%3F%3Calert_time%3E.%2B)%20slot%22%20%20%20%20%20%7C%20eval%20_time%3Dstrptime(alert_time%2C%20%22%25b%20%25d%20%25H%3A%25M%3A%25S%22)%20%20%20%20%20%7C%20eval%20date_hour%3Dstrftime(_time%2C%22%25H%22)%20%20%20%20%7C%20eval%20day_of_week%20%3D%20strftime(_time%2C%22%25A%22)%20%20%20%20%7C%20eval%20date_wday%20%3D%20strftime(_time%2C%20%22%25w%22)%20%20%20%20%7C%20sort%20-%20_time%20%20%20%7C%20search%20date_hour%3E%3D7%20date_hour%3C%3D17%20date_wday%3E%3D1%20date_wday%3C%3D5%20%20%20%20%7C%20rex%20field%3Df5_pool_monitor%20%22(%3F%3Cpaycluster%3Epay.%2B%5B0-9%5D).%2B(%3F%3Cdatacenter%3E%5Bhw%5Ddc)%22%20%20%20%20%7C%20search%20paycluster%3Dpay06%20%7C%20dedup%20_raw&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1708084649.2017262_28F65100-3C82-4CB7-8F25-B612CCC1B240#" target="_blank" rel="noopener"&gt;syslog_alb&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Feb 2024 12:44:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/searching-events-for-quot-was-down-for-quot-and-averaging-the/m-p/677795#M231765</guid>
      <dc:creator>jyates76</dc:creator>
      <dc:date>2024-02-16T12:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: searching events for "was down for" and averaging the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/searching-events-for-quot-was-down-for-quot-and-averaging-the/m-p/677829#M231776</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263723"&gt;@jyates76&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to extract the down duratio and then run a simple search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index "was down for"
| rex "was\s+down\s+for\s+(?&amp;lt;hours&amp;gt;\d+)hr:(?&amp;lt;minutes&amp;gt;\d+)min:(?&amp;lt;seconds&amp;gt;\d+)sec"
| eval duration=hours*3600+minutes*60+seconds
| timechart perc90(duration) BY host&lt;/LI-CODE&gt;&lt;P&gt;You can test the regex at&amp;nbsp;&lt;A href="https://regex101.com/r/75pRcf/1" target="_blank"&gt;https://regex101.com/r/75pRcf/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;then you can use other functions or aggregations.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 17:16:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/searching-events-for-quot-was-down-for-quot-and-averaging-the/m-p/677829#M231776</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-02-16T17:16:19Z</dc:date>
    </item>
  </channel>
</rss>

