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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...