Splunk Search

Setting Host field value based on a file inside a tar archive

jstockamp
Communicator

I've got access combined logs from a farm of x number of servers tarred up on a daily basis. So the tar file looks like this:

todayslogs.tar
-> appserver1.log
-> appserver2.log
-> appserver3.log

How can I tell splunk to use the host name inside the tar file as the host field? I'd really rather not untar the archive before ingesting it. Surely this has to be possible.

Tags (2)

jstockamp
Communicator

Yeah, I know how to set the host name based on a segment of the filename, but in this case the filename is the name of the tar file and the hostname is part of a filename inside the tar file.

0 Karma

MarioM
Motivator

another post which might be useful to you:

Host Based on filename

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 ...