Splunk Search

How to limit column size in top reports

MattG
New Member

Here is my query:
source="WinEventLog:Application" OR source="WinEventLog:System" |top limit=10 Type,EventCode, SourceName, Message

The message field is long, consequently I cannot see the counts without scrolling. Is there a way to limit the Message fields displayed length? It would be ideal if this could be like HTML where you provide a % instead a hard char limit

Tags (2)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

If you know how long you want it to show you can append this to your search:

... | fieldformat Message=if(length(Message) > 150, substr(Message, 0, 150) + "...", Message)

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

If you know how long you want it to show you can append this to your search:

... | fieldformat Message=if(length(Message) > 150, substr(Message, 0, 150) + "...", Message)
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...