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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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