Getting Data In

Renaming Host Dynamically

peter_gianusso
Communicator

Trying to assign the "esxi_hosts" sourcetype to any event that has a value of "vm[0-9][0-9]" for the host field:

inputs.conf

[monitor://\\njros1bva0597\d$\LogFiles\W3SVC1\]
disabled = 0
host = VM99
index=imaging
whitelist = \.log$

props.conf

[source::...\\ex*.log] 
sourcetype = VM88

[source::...\\CAPPM*.log] 
sourcetype = VM11

[VM88]

TRANSFORMS-hostname = rewrite_sourcetype_from_host

transforms.conf

[rewrite_sourcetype_from_host]
SOURCE_KEY = MetaData:Host
REGEX = vm\d\d
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::esxi_hosts
0 Karma
1 Solution

peter_gianusso
Communicator

a fix to the regex of
vm\d\d
to
VM\d\d

fixed the issue

View solution in original post

0 Karma

peter_gianusso
Communicator

a fix to the regex of
vm\d\d
to
VM\d\d

fixed the issue

0 Karma

peter_gianusso
Communicator

no that won't fix the issue given the scenario...the source type is dynamically assigned in the props.conf

0 Karma

piebob
Splunk Employee
Splunk Employee

let us know if this fixes the issue, and i will convert Kristian's comment to an answer 🙂

0 Karma

peter_gianusso
Communicator

there are multiple log files in the directory and they are being assigned a sourcetype in the props.conf dynamically...I tried to simplify the information because I didn't think it was relevant...I will add the stanza

kristian_kolb
Ultra Champion

maybe I'm missing something... can't you just set the sourcetype in the monitor stanza in inputs.conf

[monitor]
sourcetype=esxi_hosts
blah blah
blah
etc.
etc.

peter_gianusso
Communicator

source type always ends up as VM88

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...