Splunk Search

pipe separated instead of csv

chetanvartak
New Member

I was wondering if it is possible to build a regex for a pipe separated file… Where the Header row carries the name of the field. Example –

EmployeeID|FirstName|LastName|MiddleName|GivenName|EmployeeStatus|EmployeeType|Action|EffectiveDate|Hire_Date|TerminationDate|RehireDate|CO_ID|Paygroup|DISTRICT|OpsDistrict|Store|JobCode|Title|Department|Country|HiringManager_Emp_ID|Supervisor_Emp_ID|StoreMenuLevel|UserRegion|UserDistrict|EmployeeClass|HomeDeptName|ManagerLevelCode|LastModifiedDate||ExpBatchDate
013216|Corey|Forey|M||A|F|PAY|2012-07-01|1999-04-03|1900-01-01|1900-01-01|GCS|GC1|033|033|339|1071|Operations Manager|575000|NULL|32342|32342|9|2|033|OPS|Ops Managers|3|2012-07-17|2013-03-08
013243|Jose|Fose|M||A|F|PAY|2012-07-01|1999-04-05|1900-01-01|1900-01-01|GCS|GC1|015|015|226|1983|Sales Associate|415000|NULL|51184|51184|6|1|015|SLS|Asst Manager|6|2013-03-01|2013-03-08


It of course works fine if I convert the file to a csv file. So basically I want to use the csv source type but use “|” instead of comma…

Tags (1)
0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

You could use a props/transform if you reuse the same file for output.

In props.conf:

[your_sourcetype]
REPORT-pullpipes = st-pull-pipe

In transforms.conf:

[st-pull-pipe]
DELIMS = "|"
FIELDS = "EmployeeID", "FirstName", "LastName", "MiddleName", etc.....

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...