Reporting

How to format numbers in scheduled email report?

rkelsey
New Member

In my scheduled report, we have numbers in the range of 382 to 6,875. I can get the numbers to align properly in the UI display, but the scheduled report aligns the 6,875 to the left and the value 382 to the right margin. I know that the reason for this is that the 6,875 is treated as a string with the comma inserted. But, I have also tried to append a space in front of the shorter number, but it doesn't align correctly.

This is what I have tried -
| eval num_records=" " + tostring(num_records,"commas")

I have tried using fieldformat after the table command, but it wasn't displaying correctly in the PDF.

I also tried using the | eval tot_records=printf("%'*d", 7, num_records) Using this one, I can't get it to pad to the correct number of digits AND use the thousands separator. Is there a way to do both?

This is what I'm seeing now.

alt text

This is the way that I would prefer to see it. alt text

Labels (1)
0 Karma

CutieHoney
Observer

I have this same question.  Is there a way to do this?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

@CutieHoney  Please post your specific question as a new question, with details of your usecase.

0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...