Getting Data In

How can I handle special characters from my log like blank spaces and asterisk? Is there like a scape character in searching?

tcmarquesi
Explorer

There is a field in my log which can assume special characters as values, as below.

action="A";parm="asdfg";ans="OK"
action="w";parm="qwert";ans="OK"
action=" ";parm="NULL";ans="ERROR"
action="*";parm="NULL";ans="ERROR"

I don't want to remove those character from my log (actually I should not), but I want to be able to find those events in my search.

I tryed to search <i>action="\ "</i> and <i>action="*"</i>, but it didn't work.

How can I search those fields properly?

Thanks,

Tiago

0 Karma

chaker
Contributor

Hi,

Take a look at:

http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/search

In the Quotes and escaping characters section:

The backslash character () is used to escape quotes, pipes, and itself. Backslash escape sequences are still expanded inside quotes. For example:

The sequence \| as part of a search will send a pipe character to the command, instead of having the pipe split between commands.
The sequence \" will send a literal quote to the command, for example for searching for a literal quotation mark or inserting a literal quotation mark into a field using rex.
The \\ sequence will be available as a literal backslash in the command.

Hope that helps.

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!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...