Solved - Extracting Hostname From Filename - Inputs - Conf On... - Splunk Community
Solved - Extracting Hostname From Filename - Inputs - Conf On... - Splunk Community
- Splunk Community
COMMUNITY
Sign In
Having an issue with bluecoat logs that are dropped on a server with a UF. Attempting to
extract the hostname with the following:
host_regex = /logs/rsyslog/bclogs/(.*)-\d{6}[.]log[.]gz
/logs/rsyslog/bclogs/ABC-G-PXYW-002-032016.log.gz
/logs/rsyslog/bclogs/AEC-G-PXYW-001-032016.log.gz
/logs/rsyslog/bclogs/ABC-G-PXYW-002-032014.log.gz
/logs/rsyslog/bclogs/DEF-G-PXYW-003-032016.log.gz
The host is coming in set as the name of the log server, rather than the name.
Thoughts?
Tags:
host_regex hostname inputs.conf universal-forwarder
https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131 1/7
23/01/2023, 20:01 Solved: Extracting hostname from filename - inputs.conf on... - Splunk Community
COMMUNITY
Sign In
Reply
1 Solution
Solution
If you've restarted your forwarder and don't have any host overrides on your
parser/indexer, your regex should work. As should something like this:
host_regex=/logs/rsyslog/bclogs/([\w-]+)(?=-\d{6}\.log\.gz)
1 Karma
Reply
Solution
If you've restarted your forwarder and don't have any host overrides on your
parser/indexer, your regex should work. As should something like this:
host_regex=/logs/rsyslog/bclogs/([\w-]+)(?=-\d{6}\.log\.gz)
https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131 2/7
23/01/2023, 20:01 Solved: Extracting hostname from filename - inputs.conf on... - Splunk Community
Reply
Thanks!
0 Karma
Reply
There may also be some metadata rewrites happening, depending on the sourcetype (for
example, the syslog sourcetype has built in rewrites).
0 Karma
Reply
https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131 3/7
23/01/2023, 20:01 Solved: Extracting hostname from filename - inputs.conf on... - Splunk Community
0 Karma
Reply
0 Karma
Reply
1 Karma
Reply
https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131 4/7
23/01/2023, 20:01 Solved: Extracting hostname from filename - inputs.conf on... - Splunk Community
dewald13
COMMUNITY 03-21-2013 09:39 AM
Path Finder Sign In
"^\/logs\/rsyslog\/bclogs\/(.*)-\d{6}[.]log[.]gz"
0 Karma
Reply
0 Karma
Reply
https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131 5/7
23/01/2023, 20:01 Solved: Extracting hostname from filename - inputs.conf on... - Splunk Community
/k
0 Karma
Reply
New Year, New Special: Review a Security Product & Receive a $25 Visa Card… Plus an ...
We’re excited to announce a new Splunk Love special for 2023: Review Splunk Enterprise
Security, Cloud, or ...
NEW! Splunk APM Autodetect Improves Accuracy and Reduces Manual Effort for Service
...
New Autodetect, from Splunk Application Performance Monitoring (APM), uses machine
learning to significantly ...
https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131 6/7
23/01/2023, 20:01 Solved: Extracting hostname from filename - inputs.conf on... - Splunk Community
COMMUNITY
splunk-enterprise universal-forwarder props.conf forwarder windows indexing
Sign In
timestamp inputs.conf indexer csv sourcetype json syslog transforms.conf
line-breaking
View All
Sitemap | Privacy | Website Terms of Use | Splunk Licensing Terms | Export Control | Modern Slavery Statement | Splunk Patents
Splunk, Splunk>, Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk Inc. in the
United States and other countries. All other brand names, product names, or trademarks belong to their respective owners.
https://community.splunk.com/t5/Getting-Data-In/Extracting-hostname-from-filename-inputs-conf-on-UF-host-regex/m-p/69131 7/7