Refine your search:

I am indexing apache logs and have them rotating on a frequent basis. The log rotation will rename the file to error_log.1 and so forth...

I have noticed that some of my sourcetypes end up with a "-1" or "-2" at the end. For example, I have specified sourcetype=apache_error in my inputs.conf. However, I have noticed that I have some random "apache_error-2" and "apache_error-1" sourcetypes in my index. Why is this occurring?

My inputs.conf looks like this:

[source::.../var/log/httpd/error_log]
sourcetype = apache_error

asked 14 Jul '10, 17:32

Simeon's gravatar image

Simeon ♦
3.7k5628
accept rate: 26%


One Answer:

In this scenario, there is the possibility that Splunk may try to index already rotated log files. This can especially occur if you have a forwarder that is turned off and the log file gets rotated multiple times. For this scenario, you can simply add a regex that recognizes the additional digit. Since Splunk performs a CRC check against the files indexed, it should not re-index old data. The proper inputs.conf stanza would look as follows:

[source::.../var/log/httpd/error_log(.\d+)?]
sourcetype = apache_error
link

answered 14 Jul '10, 17:35

Simeon's gravatar image

Simeon ♦
3.7k5628
accept rate: 26%

you said inputs.conf in your original description - may wanna change that to props.conf :)

(08 Sep '10, 20:35) amrit ♦
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:

×187
×154
×37

Asked: 14 Jul '10, 17:32

Seen: 315 times

Last updated: 14 Jul '10, 17:35

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