Getting Data In

How to create sourcetype for different type of files in a same folder

john
Communicator

hi,

Logs is the foldername which I am having two types of files which having same format of data.Since splunk not breaking lines on date I am using line breaking and its not working since its working fine in priview b4 indexing here is my props.cofig and input.cofig
this is the content of file iam working on.

18 Apr...........
<xml........>
<.......>

18 Apr..........
.........
...........

Input.confg

[monitor://C:\newlogs\Logs\kllogs]
disabled = false
followTail = 0
crcSalt = <SOURCE>

Props

[source::C:\\newlogs\\Logs\\*\\Server.log.*]
sourcetype=server
[server]
SHOULD_LINEMERGE=true
BREAK_ONLY_BEFORE_DATE=false
BREAK_ONLY_BEFORE=\d\d\s\w+\s
MAX_EVENTS=200000

[source::C:\\newlogs\\Logs\\*\\Database.log.*]
sourcetype=data
[data]
SHOULD_LINEMERGE=true
BREAK_ONLY_BEFORE_DATE=false
BREAK_ONLY_BEFORE=\d\d\s\w+\s
MAX_EVENTS=200000

I have set soucetype as automatic while indexing files.Iam not able to find out what is the issue.Please help..

Tags (1)
0 Karma

yannK
Splunk Employee
Splunk Employee

Few questions :

  • First, once indexes, are the sourcetypes data and server applied to the correct files ?
  • Then if you search on a sample of the log on all time, do you find the event, are they merged together, or with a wrong timestamp ?
0 Karma

john
Communicator

When i have indexed the files seperately in splunk then sourcetype is working.But for both files the automatic source type is not working splunk is taking some default source type not the source type that i have given like data and server.

0 Karma

john
Communicator

Thanks yannk.yes sourcetypes applied to the correct files.Timestamp is same.But as u said events are merged together.what is the issue and how to resolve it.

I have reindexed that file many times by changing the sourcetypes alone.But no change iam getting events in same way getting like b4.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...