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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...