Splunk Enterprise

Customize table- How to display the output in a table format?

Vani_26
Path Finder

I want to display the output in a table format.

Basically I have a list of responses values fields that I want to printout, but only if they have something in them.
I don't want to routinely display 10 extra fields that are usually with empty.

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

  You can use a wildcard to display all available fields, but will have to eliminate some built-in fields first.--how to do that

I gave an example of how to do that.  Here's another one.

...
| fields - _* 
| fields success, error,  failure , total_count 
| table *
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Can you be more specific about your use case, please?

Tables will display a field (column) if told to display it - even if that field is null or doesn't exist.  You can use a wildcard to display all available fields, but will have to eliminate some built-in fields first.

...
```Adjust this line to remove any other unwanted fields```
| fields - punct splunk_server* linecount
| table _time *
---
If this reply helps you, Karma would be appreciated.
0 Karma

Vani_26
Path Finder

Can you be more specific about your use case, please?

i have query where i am getting the count for success, error,  failure , total_count etc , So, when i search my query for 24 hrs, Depends on the logs, sometimes i will not have data for failure, sometimes for error and so on...
So, when i make these fields as |table sucess error failure total_count  , all these fields should not get displayed, only the fields which contains data should get displayed.


Tables will display a field (column) if told to display it - even if that field is null or doesn't exist.---Yes correct


  You can use a wildcard to display all available fields, but will have to eliminate some built-in fields first.--how to do that

0 Karma

richgalloway
SplunkTrust
SplunkTrust

  You can use a wildcard to display all available fields, but will have to eliminate some built-in fields first.--how to do that

I gave an example of how to do that.  Here's another one.

...
| fields - _* 
| fields success, error,  failure , total_count 
| table *
---
If this reply helps you, Karma would be appreciated.

Vani_26
Path Finder

thank you, it worked

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...