Getting Data In

How to extract the Fields from .txt file

pbsuju
Explorer

I am indexing Server.txt file from 1000+ forwarders. The file format is as below. I want to extract below header values as field while indexing it. Could someone please suggest what need to be added in props.conf of indexer to extract these fields. I am using splunk version of 6.4
ServerName,OSVersion,Make,Uptime,LastReboot (Fields to be extracted)

ServerName,OSVersion,Make,Uptime,LastReboot
Server1,Windows2008 R2,23hrs,10/10/2017
Server2,Windows2012 R2,13hrs,11/12/2107
Server3,Windows2012 R2,13hrs,11/11/2017

Tags (1)
0 Karma
1 Solution

mtulett_splunk
Splunk Employee
Splunk Employee

Since your data is already in CSV format, you can enable CSV extraction using the header row as the field names. Your props.conf should look like this:

[ csv_custom ]
DATETIME_CONFIG=NONE
INDEXED_EXTRACTIONS=csv
FIELD_DELIMITER=,

Note: You will need to distribute this config to the universal forwarders as well, since they need the configuration to correctly read the CSV file. Are you doing this, or are you only placing the config on the indexer?

This config appears to work correctly for me (I added the missing make field into the data):

CSV Extraction

View solution in original post

0 Karma

pbsuju
Explorer

I already have below in props.conf of indexer . But I don't see fields getting extracted.

[server_Input]
INDEXED_EXTRACTIONS = CSV
FIELD_DELIMITER = ,
FIELD_QUOTE = NONE
HEADER_FIELD_LINE_NUMBER = 1
DATETIME_CONFIG = NONE
CHECK_METHOD = modtime

0 Karma

mtulett_splunk
Splunk Employee
Splunk Employee

I've updated my answer slightly.

0 Karma

mtulett_splunk
Splunk Employee
Splunk Employee

Since your data is already in CSV format, you can enable CSV extraction using the header row as the field names. Your props.conf should look like this:

[ csv_custom ]
DATETIME_CONFIG=NONE
INDEXED_EXTRACTIONS=csv
FIELD_DELIMITER=,

Note: You will need to distribute this config to the universal forwarders as well, since they need the configuration to correctly read the CSV file. Are you doing this, or are you only placing the config on the indexer?

This config appears to work correctly for me (I added the missing make field into the data):

CSV Extraction

0 Karma

pbsuju
Explorer

Thanks. It worked.

0 Karma
Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...