Splunk Search

Format results with comma thousands separator

Oren
Explorer

How do I format the output to have comma separators - I want 1,234,567, not 1234567. Any easy way?

Given a query like:

eventtype=request | sistats sum(http_bytes) as bytes by http_domain | sort -bytes | head 100

I'd like bytes to be more human readable.

0 Karma
1 Solution

Stephen_Sorkin
Splunk Employee
Splunk Employee

You can use the tostring(X, "commas") function in eval (http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions):

eventtype=request | stats sum(http_bytes) as bytes by http_domain | sort -bytes | eval bytes = tostring(bytes, "commas") | head 100

View solution in original post

juanxiayan
Explorer

If you said that, I can't draw chart(or graph).

Stephen_Sorkin
Splunk Employee
Splunk Employee

You can use the tostring(X, "commas") function in eval (http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions):

eventtype=request | stats sum(http_bytes) as bytes by http_domain | sort -bytes | eval bytes = tostring(bytes, "commas") | head 100
Get Updates on the Splunk Community!

Admin Your Splunk Cloud, Your Way

Join us to maximize different techniques to best tune Splunk Cloud. In this Tech Enablement, you will get ...

Cloud Platform | Discontinuing support for TLS version 1.0 and 1.1

Overview Transport Layer Security (TLS) is a security communications protocol that lets two computers, ...

New Customer Testimonials

Enterprises of all sizes and across different industries are accelerating cloud adoption by migrating ...