<?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 do I format the output in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37693#M8482</link>
    <description>&lt;P&gt;Just adding my 2 cents with a practical example, here I go:&lt;/P&gt;

&lt;P&gt;index="idx_apache" action=purchase | stats count by product_name, price | eval total=(price*count) | eval PreçoUnit="U$ ". tostring(price,"commas") | eval TotalFinal="U$ ". tostring(total,"commas") | rename count -&amp;gt; QtdVendido | sort -total | fields - price, total&lt;/P&gt;

&lt;P&gt;This query will retrieve information about the purchased products based on Apache access logs.&lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:46:43 GMT</pubDate>
    <dc:creator>wagnerbianchi</dc:creator>
    <dc:date>2020-09-28T12:46:43Z</dc:date>
    <item>
      <title>How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37688#M8477</link>
      <description>&lt;P&gt;on a chart or timechart?  I want to have the output be in currency format. I can use the eval and tostring() for a cludge, but is there a better way?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2010 19:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37688#M8477</guid>
      <dc:creator>JohnB</dc:creator>
      <dc:date>2010-08-26T19:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37689#M8478</link>
      <description>&lt;P&gt;Using &lt;CODE&gt;eval&lt;/CODE&gt; is the best way to solve this problem.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2010 23:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37689#M8478</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-26T23:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37690#M8479</link>
      <description>&lt;P&gt;There is unfortunately not a better way currently. It would be nice to have the charts and tables able to render numbers without changing the underlying data as &lt;CODE&gt;eval()&lt;/CODE&gt; does (for example, sorting columns of numbers and timestamps doesn't work right when they've been converted to strings for display formatting, and automatic drilldown won't work with such post-reporting conversions on charts).&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 11:42:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37690#M8479</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-27T11:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37691#M8480</link>
      <description>&lt;P&gt;I used eval X="$" . tostring(X,"commas") &lt;BR /&gt;
to format, however, there is a bug in tostring(X,"commas") it's supposed to be in comma &amp;amp; 2 decimal places format, but alas, it's not. It's a wonder why I keep telling Godfrey QA needs to be better?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 19:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37691#M8480</guid>
      <dc:creator>JohnB</dc:creator>
      <dc:date>2010-08-27T19:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37692#M8481</link>
      <description>&lt;P&gt;What is the exact string that tostring(X, "commas") is failing on? I've tried this (limited) example successfully: | stats count | eval count =123456789.12345 | eval count = "$" . tostring(count, "commas"). I'll file a bug on your behalf if you help me reproduce.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 20:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37692#M8481</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2010-08-27T20:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37693#M8482</link>
      <description>&lt;P&gt;Just adding my 2 cents with a practical example, here I go:&lt;/P&gt;

&lt;P&gt;index="idx_apache" action=purchase | stats count by product_name, price | eval total=(price*count) | eval PreçoUnit="U$ ". tostring(price,"commas") | eval TotalFinal="U$ ". tostring(total,"commas") | rename count -&amp;gt; QtdVendido | sort -total | fields - price, total&lt;/P&gt;

&lt;P&gt;This query will retrieve information about the purchased products based on Apache access logs.&lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37693#M8482</guid>
      <dc:creator>wagnerbianchi</dc:creator>
      <dc:date>2020-09-28T12:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37694#M8483</link>
      <description>&lt;P&gt;The best option would be to use | fieldformat amount= "$" + tostring(amount, "commas"). Using fieldformat vs. eval keeps the data numeric, whereas email considers the data to be a string.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2014 21:50:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37694#M8483</guid>
      <dc:creator>msmapper</dc:creator>
      <dc:date>2014-03-26T21:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37695#M8484</link>
      <description>&lt;P&gt;correction to above its not email but eval , i guess that is  a typo &lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 05:49:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37695#M8484</guid>
      <dc:creator>nawneel</dc:creator>
      <dc:date>2015-04-28T05:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I format the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37696#M8485</link>
      <description>&lt;P&gt;For anyone looking to format using integers:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stat_name=sales | timechart sum(total_price) AS total | eval cents = substr(total, -2) | eval dollars = substr(total, 1, len(total) - 2) | eval Revenue = "$" + tostring(dollars, "commas") + "." + cents
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:58:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-format-the-output/m-p/37696#M8485</guid>
      <dc:creator>si_rbrisita</dc:creator>
      <dc:date>2016-01-21T20:58:04Z</dc:date>
    </item>
  </channel>
</rss>

