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 ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...