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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...