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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...