<?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 Creating mean time to repair out of ping output script in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-mean-time-to-repair-out-of-ping-output-script/m-p/440748#M169037</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I know there's probably a simple answer, but being relatively new to Splunk, I'm still trying to get my head around the logic. I want to create a dashboard panel that shows the "mean time to repair" using a log time stamp built off a ping script I've developed. So it would calculate the total number of "down" outputs and then when it becomes available, use the "pingtime" to show the MTTR. How do I do that using the "eval"? Or is eval the wrong way? Here's the events that I'm looking at.&lt;/P&gt;

&lt;P&gt;6/6/18&lt;BR /&gt;
8:26:48.000 AM&lt;BR /&gt;&lt;BR /&gt;
20180606082648 IP address is available&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NID =   &amp;lt;nodename&amp;gt;  
pingtime =  20180606082648  
status =    available   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;6/6/18&lt;BR /&gt;
8:21:56.000 AM&lt;BR /&gt;&lt;BR /&gt;
20180606082156 IP address is down or not reachable&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NID =   &amp;lt;nodename&amp;gt;  
pingtime =  20180606082156  
status =    down
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Jun 2018 16:52:20 GMT</pubDate>
    <dc:creator>heybails88</dc:creator>
    <dc:date>2018-06-07T16:52:20Z</dc:date>
    <item>
      <title>Creating mean time to repair out of ping output script</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-mean-time-to-repair-out-of-ping-output-script/m-p/440748#M169037</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I know there's probably a simple answer, but being relatively new to Splunk, I'm still trying to get my head around the logic. I want to create a dashboard panel that shows the "mean time to repair" using a log time stamp built off a ping script I've developed. So it would calculate the total number of "down" outputs and then when it becomes available, use the "pingtime" to show the MTTR. How do I do that using the "eval"? Or is eval the wrong way? Here's the events that I'm looking at.&lt;/P&gt;

&lt;P&gt;6/6/18&lt;BR /&gt;
8:26:48.000 AM&lt;BR /&gt;&lt;BR /&gt;
20180606082648 IP address is available&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NID =   &amp;lt;nodename&amp;gt;  
pingtime =  20180606082648  
status =    available   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;6/6/18&lt;BR /&gt;
8:21:56.000 AM&lt;BR /&gt;&lt;BR /&gt;
20180606082156 IP address is down or not reachable&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NID =   &amp;lt;nodename&amp;gt;  
pingtime =  20180606082156  
status =    down
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jun 2018 16:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-mean-time-to-repair-out-of-ping-output-script/m-p/440748#M169037</guid>
      <dc:creator>heybails88</dc:creator>
      <dc:date>2018-06-07T16:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Creating mean time to repair out of ping output script</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-mean-time-to-repair-out-of-ping-output-script/m-p/440749#M169038</link>
      <description>&lt;P&gt;With a lot of painstaking work, this is what we've come up with: &lt;BR /&gt;
index=nid_availability NIDIP= "chosen IP address from dropdown field2"&lt;BR /&gt;
| rename NIDIP as IP&lt;BR /&gt;
|lookup nidnodes.csv IP &lt;BR /&gt;
| transaction NID startswith="up_or_down=down" endswith="up_or_down=available"&lt;BR /&gt;
| stats avg(duration) as avg_outage by NID &lt;BR /&gt;
| eval MTTR=tostring(avg_outage, "duration") &lt;BR /&gt;
| table NID  MTTR&lt;/P&gt;

&lt;P&gt;The "up_or_down" is an extract from the output of the ping script.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:08:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-mean-time-to-repair-out-of-ping-output-script/m-p/440749#M169038</guid>
      <dc:creator>heybails88</dc:creator>
      <dc:date>2020-09-29T20:08:56Z</dc:date>
    </item>
  </channel>
</rss>

