Anyone else having trouble or have guidance to split fields backslashes such as with file paths?
The field value is displayed as:
folder1\folder2\file.txt
And the raw value is:
folder1\\folder2\\file.txt
I have tried this with no luck:
| eval RelativeTargetNameSplit = split(RelativeTargetName, '\')
| eval RelativeTargetNameSplit = split(RelativeTargetName, '\\')
| eval RelativeTargetNameSplit = split(RelativeTargetName, '\\\\')
| eval RelativeTargetNameSplit = split("aaaaaXbbbb", "X") just worked for me with double quotes and not single ones around the X.
| eval RelativeTargetNameSplit = split("aaaaaXbbbb", "X") just worked for me with double quotes and not single ones around the X.
You're right, When dealing with slashes, use quotes (").
| eval RelativeTargetNameSplit = split(RelativeTargetName, "\\")
| eval RelativeTargetNameSplit = split("folder1\folder2\file.txt", "\") worked as well.
| eval RelativeTargetNameSplit = split("folder1\folder2\file.txt", "\") does work for me but not with the input is from a field (as opposed to an explicit string)
Your example data has backslashes, your attempts have forward slashes.
Oops, updated to include the right slashed. Thanks for pointing that out.