<?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: round function doesn't work with timechart but does with table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396562#M169460</link>
    <description>&lt;P&gt;@niketnilay : That was awesome. Thank you very very much.&lt;/P&gt;</description>
    <pubDate>Sat, 12 May 2018 08:19:10 GMT</pubDate>
    <dc:creator>zacksoft</dc:creator>
    <dc:date>2018-05-12T08:19:10Z</dc:date>
    <item>
      <title>round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396556#M169454</link>
      <description>&lt;P&gt;This following  doesn't work. I don't see the decimals limiting to two digits.&lt;BR /&gt;
| eval n=round(var5,2) | timechart span=1d avg(n) as avg_count by host&lt;/P&gt;

&lt;P&gt;But when I do this,&lt;BR /&gt;
| eval n=round(var5,2) | table var5 &lt;BR /&gt;
It works.&lt;/P&gt;

&lt;P&gt;I tested that in timechart command neither round nor ceiling function is working.&lt;BR /&gt;
Any suggestion on how to make it work?&lt;BR /&gt;
Or something wrong with my Splunk set up.&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 13:25:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396556#M169454</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2018-05-11T13:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396557#M169455</link>
      <description>&lt;P&gt;That's because you are rounding the value in n, but you're not rounding the result of the &lt;CODE&gt;avg()&lt;/CODE&gt; function.&lt;/P&gt;

&lt;P&gt;So you need to do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval n=round(var5,2) | timechart span=1d eval(round(avg(n),2)) as avg_count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 May 2018 13:34:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396557#M169455</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-11T13:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396558#M169456</link>
      <description>&lt;P&gt;Could you help how to use ceiling in the same search.&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 13:45:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396558#M169456</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2018-05-11T13:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396559#M169457</link>
      <description>&lt;P&gt;Have a look at the search reference for how to use the timechart command. Especially on how to use eval functions: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.0/SearchReference/Timechart"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.0/SearchReference/Timechart&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you want to apply &lt;CODE&gt;ceiling()&lt;/CODE&gt;, just put that in instead of &lt;CODE&gt;round()&lt;/CODE&gt;. For example  (leaving the var5 value as is now, although you can already apply ceiling to that as well if you want):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval n=var5 | timechart span=1d eval(ceiling(avg(n)) as avg_count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 May 2018 14:24:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396559#M169457</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-11T14:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396560#M169458</link>
      <description>&lt;P&gt;I tried it. But ceiling function won't work. It says &lt;BR /&gt;
 | eval n=var5 | timechart span=1d eval(ceiling(avg(n)) as avg_count by host&lt;BR /&gt;
Mismatched quotes and/or parenthesis.&lt;/P&gt;

&lt;P&gt;and with this  | eval n=var5 | timechart span=1d eval(ceiling(avg(n))) as avg_count by host&lt;BR /&gt;
The eval expression has no fields: 'ceiling(avg(n))'&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 07:57:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396560#M169458</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2018-05-12T07:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396561#M169459</link>
      <description>&lt;P&gt;@zacksoft try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt;
| timechart span=1d eval(avg(var5)) as avg_count by host
| foreach * [eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=ceiling('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;PS: I have taken out &lt;CODE&gt;| eval n=round(var5,2)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 08:13:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396561#M169459</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-12T08:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396562#M169460</link>
      <description>&lt;P&gt;@niketnilay : That was awesome. Thank you very very much.&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 08:19:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396562#M169460</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2018-05-12T08:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: round function doesn't work with timechart but does with table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396563#M169461</link>
      <description>&lt;P&gt;@zacksoft glad it worked. You can up vote the comment if it helped... Happy Weekend!&lt;/P&gt;</description>
      <pubDate>Sat, 12 May 2018 08:31:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/round-function-doesn-t-work-with-timechart-but-does-with-table/m-p/396563#M169461</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-05-12T08:31:02Z</dc:date>
    </item>
  </channel>
</rss>

