<?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: How to display comma-delimited numbers in a timechart sum in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357293#M105696</link>
    <description>&lt;P&gt;To answer your question, use the following&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| timechart span=1mon eval(tostring(sum(myCount), "commas")) by index&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Another recommendation, remove your second line and put the time bounds in the first part of the query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| tstats count AS myCount WHERE index=* earliest=-1mon@mon latest=@mon by index, _time&lt;BR /&gt;
 | timechart span=1mon eval(tostring(sum(myCount), "commas")) by index&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2017 18:20:33 GMT</pubDate>
    <dc:creator>rjthibod</dc:creator>
    <dc:date>2017-05-01T18:20:33Z</dc:date>
    <item>
      <title>How to display comma-delimited numbers in a timechart sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357292#M105695</link>
      <description>&lt;P&gt;I have this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count AS myCount WHERE index=* by index, _time 
| where _time &amp;gt; relative_time(now(), "-1mon@mon") AND _time &amp;lt; relative_time(now(), "@mon") 
| timechart span=1mon sum(myCount) by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which returns one column for each index, with the heading being the indexes name, and the content under that the sum of events for that index in the specified time-frame.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;How can I get this sum to display with commas?&lt;/STRONG&gt; (like 158,313,959 instead of 158313959.)&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 18:13:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357292#M105695</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2017-05-01T18:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to display comma-delimited numbers in a timechart sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357293#M105696</link>
      <description>&lt;P&gt;To answer your question, use the following&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| timechart span=1mon eval(tostring(sum(myCount), "commas")) by index&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Another recommendation, remove your second line and put the time bounds in the first part of the query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| tstats count AS myCount WHERE index=* earliest=-1mon@mon latest=@mon by index, _time&lt;BR /&gt;
 | timechart span=1mon eval(tostring(sum(myCount), "commas")) by index&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 18:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357293#M105696</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-05-01T18:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to display comma-delimited numbers in a timechart sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357294#M105697</link>
      <description>&lt;P&gt;Just add following foreach command to your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...your current search.. | foreach * [eval "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=tostring('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',"commas") ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 May 2017 18:27:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357294#M105697</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-01T18:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to display comma-delimited numbers in a timechart sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357295#M105698</link>
      <description>&lt;P&gt;Adding the eval to the timechart was something I had already tried. Does not work.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 18:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357295#M105698</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2017-05-01T18:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to display comma-delimited numbers in a timechart sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357296#M105699</link>
      <description>&lt;P&gt;I am confused because I get the result you requested if I copy and paste the query I posted. In general, one should avoid &lt;CODE&gt;foreach&lt;/CODE&gt; as much as possible. &lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 19:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357296#M105699</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-05-01T19:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to display comma-delimited numbers in a timechart sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357297#M105700</link>
      <description>&lt;P&gt;Okay, I tried this again because of your comment and it does work. Last time I tried it I got no results found. I'm thinking I must have had the time picker on some weird setting. So I'm using this now, including the recommendation. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2017 22:01:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357297#M105700</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2017-05-01T22:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to display comma-delimited numbers in a timechart sum</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357298#M105701</link>
      <description>&lt;P&gt;Thank you for reconsidering.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2017 10:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-comma-delimited-numbers-in-a-timechart-sum/m-p/357298#M105701</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2017-05-02T10:08:26Z</dc:date>
    </item>
  </channel>
</rss>

