<?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 TimeChart round values: How to create search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614310#M213537</link>
    <description>&lt;P&gt;I need to round the max(Delay) and avg(Delay) to 3 decimals in the following command:&lt;BR /&gt;my search |&amp;nbsp;timechart span=5m avg(Delay) max(Delay) by host&lt;BR /&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 15:39:53 GMT</pubDate>
    <dc:creator>DPOIRE</dc:creator>
    <dc:date>2022-09-23T15:39:53Z</dc:date>
    <item>
      <title>TimeChart round values: How to create search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614310#M213537</link>
      <description>&lt;P&gt;I need to round the max(Delay) and avg(Delay) to 3 decimals in the following command:&lt;BR /&gt;my search |&amp;nbsp;timechart span=5m avg(Delay) max(Delay) by host&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 15:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614310#M213537</guid>
      <dc:creator>DPOIRE</dc:creator>
      <dc:date>2022-09-23T15:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: TimeChart round values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614324#M213538</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245805"&gt;@DPOIRE&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;for my knowledge, you cannot calculate two values in timechart, so you need to use stats,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my search 
| span span=5m _time
| stats avg(Delay) AS avgDelay max(Delay) AS maxDelay by _time host
| eval avgDelay=round(avgDelay,3), maxDelay=round(maxDelay,3)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 14:03:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614324#M213538</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-23T14:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: TimeChart round values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614339#M213539</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DPOIRE_0-1663946437101.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/21645i012B1D3D2B9FE990/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DPOIRE_0-1663946437101.png" alt="DPOIRE_0-1663946437101.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 15:20:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614339#M213539</guid>
      <dc:creator>DPOIRE</dc:creator>
      <dc:date>2022-09-23T15:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: TimeChart round values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614394#M213540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245805"&gt;@DPOIRE&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;sorry my error!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;my search 
| bin span=5m _time
| stats avg(Delay) AS avgDelay max(Delay) AS maxDelay by _time host
| eval avgDelay=round(avgDelay,3), maxDelay=round(maxDelay,3)&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 21:17:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614394#M213540</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-23T21:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: TimeChart round values: How to create search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614406#M213541</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245805"&gt;@DPOIRE&lt;/a&gt;&amp;nbsp;You can certainly calculate as many values in timechart as you like and round them as needed, although rounding after a timechart+split_by needs to use "foreach" because the field names are named by the split field (in your case 'host')&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| timechart span=5m avg(Delay) max(Delay) by host
| foreach * [ eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', 3) ]&lt;/LI-CODE&gt;&lt;P&gt;Note that the left hand side of eval uses double quotes and the right hand side, single, round the &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;.&lt;/P&gt;&lt;P&gt;That is to take care of any potential odd characters in the host results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Sep 2022 03:21:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/TimeChart-round-values-How-to-create-search/m-p/614406#M213541</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-09-24T03:21:29Z</dc:date>
    </item>
  </channel>
</rss>

