<?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: Multiple average time calculations in a single search for Trellis Display in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-average-time-calculations-in-a-single-search-for/m-p/414541#M119419</link>
    <description>&lt;P&gt;Just add &lt;CODE&gt;by servicename&lt;/CODE&gt; at the end of your chart command.&lt;/P&gt;</description>
    <pubDate>Tue, 22 May 2018 15:03:22 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-05-22T15:03:22Z</dc:date>
    <item>
      <title>Multiple average time calculations in a single search for Trellis Display</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-average-time-calculations-in-a-single-search-for/m-p/414540#M119418</link>
      <description>&lt;P&gt;This is my log format. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
    servicename: ServiceOne
    end.timestamp: 20000
    start.timestamp: 19920
}

{
    servicename: ServiceTwo
    end.timestamp: 30000
    start.timestamp: 29520
}

{
    servicename: ServiceOne
    end.timestamp: 59800
    start.timestamp: 59220
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am trying to calculate the average time taken for each service and display it in a trellis Layout on my Dashboard. &lt;/P&gt;

&lt;P&gt;For example as follows: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ServiceOne(milliSecond) ServiceTwo(milliSecond) ServiceThree(milliSecond) 

200                     320                     455
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am able to capture the data, subtract the time to get the duration for each time the service is called and get its average to display it for one service. Is there a way I could do this for all my services (there are 8 of them) in a single search to display it in a single Trellis layout as shown in the above example? Thanks. &lt;/P&gt;

&lt;P&gt;This is what I have done which works for a single service. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;servicename=Service* | Convert num(end.timestamp) as end_time | Convert num(start.timestamp) as start_time | eval time_taken=(end_time - start_time) | eval AllServicesDurationField=toString(time_taken) | chart avg(AllServicesDurationField) as "All Services" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 May 2018 12:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-average-time-calculations-in-a-single-search-for/m-p/414540#M119418</guid>
      <dc:creator>angersleek</dc:creator>
      <dc:date>2018-05-22T12:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple average time calculations in a single search for Trellis Display</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-average-time-calculations-in-a-single-search-for/m-p/414541#M119419</link>
      <description>&lt;P&gt;Just add &lt;CODE&gt;by servicename&lt;/CODE&gt; at the end of your chart command.&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 15:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-average-time-calculations-in-a-single-search-for/m-p/414541#M119419</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-22T15:03:22Z</dc:date>
    </item>
  </channel>
</rss>

