Refine your search:

Hi,

I found the sourcetype that I've been set was growing with incremental digit. e.g. sourcetype=abc-1, sourcetype=abc-2, sourcetype=abc-3 ...

Do you know why this happens?

Thanks! Philip

asked 28 Dec '10, 04:36

hochit's gravatar image

hochit
10115
accept rate: 100%


2 Answers:

It isn't so obvious how to force a sourcetype using props.conf. Here is how we do it:

In props.conf on the indexer you need to identify the files you want to map to a sourcetype using some sort of expression that looks similar to the inputs.conf expressions:

[source::/my/appserver/path/.../logs/access*]
TRANSFORMS-appserver_access = fix_appserver_access_sourcetype

Then you need to put this in transforms.conf:

[fix_appserver_access_sourcetype]
REGEX = .
FORMAT = sourcetype::appserver_access
DEST_KEY = MetaData:Sourcetype

Then you need to restart the indexer. All new files that are identified will get the new sourcetype. The files it has already seen will still get mapped with the old sourcetype.

--

Another note: If you want to force the sourcetype on the inputs.conf you do that on the forwarder.

--

You can also tag sources that have already been indexed to give them an sourcetype alias. This can get really tedious if you have hundreds and hundreds of files that were indexed with the wrong sourcetype.

link

answered 28 Dec '10, 21:14

rotten's gravatar image

rotten
3061110
accept rate: 17%

Splunk will try to learn your sourcetype automatically. As a result, similar source files with varying event punctuation may show up with the same name with incremental digits.

The correct way to fix this is to explicitly set the sourcetype for your data source. This can be done within inputs.conf or via the gui. In some scenarios, you may not be able to explicitly set this as the input source has many sourcetypes. In that case, you must use a props.conf setting to identify individual sourcetypes (somewhat of an advanced topic).

If you want to get rid of the automatic sourcetyping, you can disable the learned sourcetypes although that is not recommended. To do this, you can simply disable the learned app via the UI. Unfortunately, you cannot go back and change the indexed sourcetype value without re-indexing.

link

answered 28 Dec '10, 16:36

Simeon's gravatar image

Simeon ♦
4.1k91034
accept rate: 26%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×247

Asked: 28 Dec '10, 04:36

Seen: 1,799 times

Last updated: 23 Feb '11, 13:22

Copyright © 2005-2012 Splunk Inc. All rights reserved.