Getting Data In

Extracting fields from a simple KV input

magnuspenilsson
Explorer

I'm a trying to index multi line key value (KV) data from a TCP input. I have full control of the input so I can modify it any way, this is hove it looks at the moment:

Id = '1657'
Timestamp = '2011-03-14 13:28:01'
ApplicationId = 'My Test Application'
Severity = 'INFO'
User = 'George'
UserContext = 'Server5\George'
Message = 'File: C:\temp\MyFile.txt Deleted'

I want logs to be indexed and searchable by the keys above. At the moment the source type is set to 'tcp' and I can't filter searches on e.g. 'Message'.

Is there a existing source type that I can use? Or How do a create a new one and/or set up field extractions etc?

//A novice

Tags (4)
0 Karma

Ledion_Bitincka
Splunk Employee
Splunk Employee

First, I would suggest changing the log format slightly to:

2011-03-14 13:28:00
Id="1657"
ApplicationId="My Test Application"
Severity="INFO"
User="George"
UserContext="Server5\George"
Message="File: C:\temp\MyFile.txt Deleted"
...
...

secondly, to specify a sourcetype for your data you can then edit inputs.conf to:

inputs.conf
[tcp://12345]
sourcetype = SomeName
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...