All Apps and Add-ons

Log Segregation ?

himapate
Explorer

Hi ,

I am having a log file , lets say Splunk.log which contains two type of logs written in it consider "internal" and "external"
Is there any way to segregate this in inputs.conf while motoring the log file.
The purpose is that i need to assign different sourcetype to each of them.

Also, is this possible to be done at in rsyslog which is acting as my centralized syslog server.
I have done the dynamic configuration of seperating it by hostname but is there any way to seperate by any message in the log incoming?

Thankyou

0 Karma

ddrillic
Ultra Champion
0 Karma

esix_splunk
Splunk Employee
Splunk Employee

Splunk doesnt have a default capability to read logs and assign different sourcetypes based on inputs.conf. What you could do is use props / transforms to Split the Logs to different sourcetypes at the parsing level.

At a high level, you ingest the file as "SourcetypeA". Then based on regex rules defined, you can re-categorize the files as "Sourcetype1" or "Sourcetype2".

You do need to be aware of where in your Splunk environment this needs to happen and the ramifications of doing this when you have high volumes of data and indexers that are resource quenched..

See this article : https://answers.splunk.com/answers/221294/how-to-split-a-log-into-multiple-sourcetypes-on-a.html

It outlines how to do this quite accurately on how to rewrite the sourcetype, again, based on a regex.

You need to also be aware that this focused more on single line events with a specific pattern occurring at the beginning of the line. If your events are multiline, this becomes much more difficult and compute intensive. Preprocessing is recommended in that case..

Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...