Splunk Search

DBConnect indexing field with backslash character

mcomfurf
Path Finder

I'm indexing a field with DBConnect that contains the backslash character, eg \, in order to escape quotation marks and hyphens within the data. This has a side effect of breaking the field extraction after the first \ character. Has anyone encountered this problem, and if so, how do you work around it?

0 Karma

mcomfurf
Path Finder

I had trouble getting the sed approach to work, though I can see how that might bear fruit if I took more time to wrestle with it. I wound up creating a new field extraction and that solved the problem.

0 Karma

jkat54
SplunkTrust
SplunkTrust

Did you use double backslash in your "new field extraction"? If so, please accept my answer. If you used another pattern, please post it here and mark it as the answer.

0 Karma

mcomfurf
Path Finder

I did not; I was able to use a simple regex based on the field's position: ^(?:[^=\n]*=){5}(?P.+)

0 Karma

jkat54
SplunkTrust
SplunkTrust

Have you tried a double backslash instead?

Maybe use rex or sedcmd to remove the backslash from the _raw field?

... | rex mode=sed field=_raw "s/\\//g"| ...

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...