Splunk Search

Splunk SDK - Search String with parameter having Spaces

duddukuri
Explorer

By using Splunk SDK, able to use the below search string and get the results from SPlunk
String searchQuery_string = "search * | head 100";

We have a field by name message in Splunk, which can have values with spaces.
Example message 1 : "Started initialization"
Example message 2 : "Completed initialization in 86 ms"

We want to run search with the message="Completed i*"
In Splunk UI search this is working fine and giving results

When tried with below as the Query string, ZERO Results
String searchQuery_string = "search message='Completed i*'";
String searchQuery_string = "search message=Completed%20i*";

Kindly help me in this regard

Tags (1)
0 Karma
1 Solution

duddukuri
Explorer

normal Java escape character () worked
String searchQuery_string = "search message=\"Completed i*\"";

View solution in original post

0 Karma

duddukuri
Explorer

normal Java escape character () worked
String searchQuery_string = "search message=\"Completed i*\"";

0 Karma
Get Updates on the Splunk Community!

Cloud Platform | Customer Change Announcement: Email Notification Will Be Available ...

The Notification Team is migrating our email service provider since currently there’s no support ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...