I have a numeric field that I convert to a comma separated number using fieldformat. The only problem is that after the conversion it changes the format from right align to left align. Since this is a numeric field, is there anyway to keep the column right-aligned with commas? It's very difficult to compare numbers within a column when they are all left-aligned. Thanks.
In Splunk 6.5, you can format a table column in a dashboard. You can apply both numeric and color formatting. This is preferable to using the fieldformat command.
fieldformat never worked consistently (when combined with other commands) to display a formatted numeric value while preserving the underlying field as numeric.
Here is the documentation showing how to Format table visualizations.
This is tricky, because the fields don't have any alignment, they're just strings in a conceptual table. However, the UI tries to make some guesses on how to display them based on their content.
Thus there's little in the search language that can control the UI behavior (unless we implement some kind of ui-hint-field which doesn't currently exist). Some more direct control in the UI would be nice, but that wouldn't persist cleanly in a search for all users. I think this boils down to an Enhancement Request.
How are you using fieldformat? Using the example below, it appears to right format in 6.5.0 when using tostring "commas".
|stats count|fields - count |eval number=10000 |fieldformat formattednumber=tostring(number,"commas")
@cchange and @season88481...Can you give example of query / mock data? It works fine for me in 6.4.3 as well as 6.5. Following is the run anywhere search I tested:
| makeresults | eval TestNumber=12345678912345 | fieldformat TestNumber=tostring(TestNumber,"commas") | table _time TestNumber