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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...