Getting Data In

Source vs Sourcetype: What's the difference?

test_qweqwe
Builder

Source - The source of an event is the name of the file, stream, or other input from which the event originates
1) Which are the sources of the event?Simulate me some real situations.

Sourcetype - The source type of an event is the format of the data input from which it originates like for windows .evt files from event viewer
1) Which are the sources type of the event? The same question.

I can not understand what applies to source and to sourcetype.
I would be glad if somebody gives examples. Or what should I read to better understand logs? I understand that there are just different logs. Some are responsible for one, the other for the other.

1 Solution

inventsekar
SplunkTrust
SplunkTrust

1) Which are the sources of the event?Simulate me some real situations.
event source can be anything. a system log file, an app log files, lookup files, etc..

2) Which are the sources type of the event? The same question. --- the type of the sources will be the sourcetype.

for example, you can add data from /var/log/messages to splunk.
for this data,

source=/var/log/messages 
and 
sourcetype=linux_syslog

Source vs sourcetype -
Source and source type are both default fields, but they are entirely different otherwise, and can be easily confused.

The source is the name of the file, stream, or other input from which a particular event originates.
The sourcetype determines how Splunk software processes the incoming data stream into individual events according to the nature of the data.
Events with the same source type can come from different sources, for example, if you monitor source=/var/log/messages and receive direct syslog input from udp:514. If you search sourcetype=linux_syslog, events from both of those sources are returned.

http://docs.splunk.com/Documentation/Splunk/7.0.0/Data/Aboutdefaultfields

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !

View solution in original post

HiroshiSatoh
Champion

The source is the entity of the log

Source type is log classification
Classification is used variously by users.
· Classification by format
· Classified by service and system
· Classified by character code
· etc

inventsekar
SplunkTrust
SplunkTrust

1) Which are the sources of the event?Simulate me some real situations.
event source can be anything. a system log file, an app log files, lookup files, etc..

2) Which are the sources type of the event? The same question. --- the type of the sources will be the sourcetype.

for example, you can add data from /var/log/messages to splunk.
for this data,

source=/var/log/messages 
and 
sourcetype=linux_syslog

Source vs sourcetype -
Source and source type are both default fields, but they are entirely different otherwise, and can be easily confused.

The source is the name of the file, stream, or other input from which a particular event originates.
The sourcetype determines how Splunk software processes the incoming data stream into individual events according to the nature of the data.
Events with the same source type can come from different sources, for example, if you monitor source=/var/log/messages and receive direct syslog input from udp:514. If you search sourcetype=linux_syslog, events from both of those sources are returned.

http://docs.splunk.com/Documentation/Splunk/7.0.0/Data/Aboutdefaultfields

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

June 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...