Splunk Search

how to indentify \| character in SPLUNK

abhayneilam
Contributor

Hi,

I have a file which contains few fields which are '|' separated, Now I have certain values in file which looks like '|' ( without any space ). example as follows:

d:\this_directory|Y|DATA

above statement is having three fields with '|' separated, but when this type of data is being imported to SPLUNK , I am getting only two fields because , it is assuming d:\this_directory|Y as a single field and 'DATA' as a second field. I have to replace | to \ | everytime before importing the data which is very painful for the big size files.

Is there any way in SPLUNK to handle this type of error !!

Please help !!

Thanks!!

Tags (4)
0 Karma

Ayn
Legend

This is no error. From what I gather in your question you haven't told Splunk how to extract field values from this log, so it's using some very generic fallback rules to try to make some sense out of it. So you need to tell Splunk how you want your fields extracted.

Setup a delims based field extraction in props.conf / transforms.conf. Something like this.

props.conf:

[yoursourcetype]
REPORT-pipedelimitedfields = pipedelimitedfields

transforms.conf:

[pipedelimitedfields]
DELIMS = "|"
FIELDS = "field1", "field2", "field3"

abhayneilam
Contributor

I have written the same lines in the configuration files but stil the same problem is there ... '|' should be a separater ,but anywhere it is getting | is not considering | as a separator.

Please help

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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