Splunk Search

Remove spaces in result of format function

BernardEAI
Communicator

I would like to make use of the format function to modify the results of a sub-search. I'm getting spaces in the output that are causing problems with my search.

I'm using CASE in the result to make the search case sensitive. My format function is:

| format "" "CASE(" "" ")" "OR name=" ""

The output of my subsearch is:

CASE( "User 1" ) OR name= CASE( "User 2" ) OR name= CASE( "User 3" ) 

The extra spaces around the search term prevents the CASE function from working. Is there any way to remove these spaces? 

Labels (1)
0 Karma
1 Solution

nickhills
Ultra Champion

This is a limitation of the the "format" command, I am not aware of anyway to prevent it adding spaces between the column/row separators/boundaries.

If my comment helps, please give it a thumbs up!

View solution in original post

nickhills
Ultra Champion

This is a limitation of the the "format" command, I am not aware of anyway to prevent it adding spaces between the column/row separators/boundaries.

If my comment helps, please give it a thumbs up!
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...