Getting Data In

Split backslash gives "unbalanced quotes"

tmontney
Builder

Trying to split a \ says unbalanced quotes. I am using the split command.

eval temp=split(mystring, "\")
Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

In SPL, a backslash is an escape character, so you'd have to escape it to use it's literal value.

eval temp=split(mystring,"\\")

View solution in original post

somesoni2
Revered Legend

In SPL, a backslash is an escape character, so you'd have to escape it to use it's literal value.

eval temp=split(mystring,"\\")

tmontney
Builder

I swear I tried that, but I did it again and it worked.

0 Karma

rlacher
Explorer

The backslash (\) character is an escape characters -- it's trying to escape the last quote in your split command. You need to use another backslash to escape the original backslash so that it is interpreted as a literal backslash character.
https://en.wikipedia.org/wiki/Escape_character

Try

eval temp=split(mystring, "\\")
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...