<?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: adding commas to numbers, chart+by breaks it. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19202#M2886</link>
    <description>&lt;P&gt;I tried this and it works just fine:&lt;BR /&gt;
index=_internal per_sourcetype_thruput host=splunkindexer * | timechart span=1d sum(kb) as TotalBytesIndexed  | fieldformat TotalBytesIndexedHuman=tostring(TotalBytesIndexed,"commas")&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:11:20 GMT</pubDate>
    <dc:creator>sansay</dc:creator>
    <dc:date>2020-09-28T13:11:20Z</dc:date>
    <item>
      <title>adding commas to numbers, chart+by breaks it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19198#M2882</link>
      <description>&lt;P&gt;Howdy all,&lt;/P&gt;

&lt;P&gt;I'm using the following search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="summary_collaboration" 
source="Inbound Messages Accepted &amp;amp; Delivered" 
OR source="Inbound Messages Refused" 
| bucket span=1d _time 
| eval formatted_time=strftime(_time, "%x")
| chart count as messages over source by formatted_time
| addtotals fieldname="7 Day Total" col=true label="Daily Total" labelfield=source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to get back data about mail messages. Since we handle a lot I'd like to put some separators in to the numbers. I've tried adding the line&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval messages=tostring(messages,"commas")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;after the &lt;CODE&gt;chart&lt;/CODE&gt; command and after the &lt;CODE&gt;addtotals&lt;/CODE&gt; command but neither changes the format of the numbers. However, and this is the tricky bit, if I remove the &lt;CODE&gt;by formatted_time&lt;/CODE&gt; portion of the chart command the commas appear, if I add it back they go away.&lt;/P&gt;

&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 20:51:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19198#M2882</guid>
      <dc:creator>colinj</dc:creator>
      <dc:date>2012-04-04T20:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: adding commas to numbers, chart+by breaks it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19199#M2883</link>
      <description>&lt;P&gt;Instead of &lt;STRONG&gt;eval&lt;/STRONG&gt;, try &lt;STRONG&gt;fieldformat&lt;/STRONG&gt;, maybe like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval formatted_time=_time | fieldformat formatted_time=strftime(formatted_time, "%x")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and/or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fieldformat messages=tostring(messages,"commas")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;eval changes the fieldtype from numeric to string. fieldformat changes the visual representation, but the underlying value remains numeric.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2012 23:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19199#M2883</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-04-04T23:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: adding commas to numbers, chart+by breaks it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19200#M2884</link>
      <description>&lt;P&gt;Even with &lt;CODE&gt;fieldformat&lt;/CODE&gt; I still get the same behavior and again if I remove the &lt;CODE&gt;by&lt;/CODE&gt; clause from the chart command I get the commas. I've also tried this with &lt;CODE&gt;timechart&lt;/CODE&gt; and I see the same behavior.&lt;/P&gt;

&lt;P&gt;This is all coming from a summary index where I've been using &lt;CODE&gt;sistats&lt;/CODE&gt; and &lt;CODE&gt;sitop&lt;/CODE&gt; to populate the index. Could that make a difference?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2012 14:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19200#M2884</guid>
      <dc:creator>colinj</dc:creator>
      <dc:date>2012-04-05T14:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: adding commas to numbers, chart+by breaks it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19201#M2885</link>
      <description>&lt;P&gt;Does anyone knows why the fieldformat is not working on chart/stats command?&lt;BR /&gt;
For instance, when trying to change the tooltip format to show value numbers with commas, doing a search like that, doesn't work:&lt;BR /&gt;
chart sum(RECORD_VALUE) AS Summary by name|fieldformat Summary=tostring(Summary,"commas")&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2013 21:15:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19201#M2885</guid>
      <dc:creator>lgmnemesis</dc:creator>
      <dc:date>2013-01-02T21:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: adding commas to numbers, chart+by breaks it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19202#M2886</link>
      <description>&lt;P&gt;I tried this and it works just fine:&lt;BR /&gt;
index=_internal per_sourcetype_thruput host=splunkindexer * | timechart span=1d sum(kb) as TotalBytesIndexed  | fieldformat TotalBytesIndexedHuman=tostring(TotalBytesIndexed,"commas")&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:11:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19202#M2886</guid>
      <dc:creator>sansay</dc:creator>
      <dc:date>2020-09-28T13:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: adding commas to numbers, chart+by breaks it.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19203#M2887</link>
      <description>&lt;P&gt;Is there a way to "fieldformat" 'commas' in UK format (##,##,###) instead of US format (###,###,###)?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2014 11:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-commas-to-numbers-chart-by-breaks-it/m-p/19203#M2887</guid>
      <dc:creator>miteshvohra</dc:creator>
      <dc:date>2014-09-22T11:22:48Z</dc:date>
    </item>
  </channel>
</rss>

