Refine your search:

1
1

We're using Syslog-ng in our environment and have a forwarder setup on syslog-ng to forward the logs to Splunk. But when they're indexed in Splunk, the sourcetype is "syslog". Is it possible to set this to the actual source type? For example our syslog-ng directory structure looks like such:

/logs/log-type/hostname/

I want to be able to set log-type to be the sourcetype in Splunk. It has to be possible!

asked 06 Apr '12, 08:59

nkitmitto's gravatar image

nkitmitto
615
accept rate: 0%


2 Answers:

You would have to set up different monitor stanzas in inputs.conf on the forwarder, e.g.;

[monitor:///logs/nginx/*/]
index = your_index
sourcetype = nginx
host_segment = 3

[monitor:///logs/cisco/*/]
index = your_index
sourcetype = cisco
host_segment = 3

etc etc

If you do not specify sourcetype (which I assume you have not done) Splunk will probably identify and classify it as syslog. And syslog is a sourcetype (the only one I think) where Splunk will automatically extract and set the host for each event in the log individually, i.e. not on a per file basis.

Therefore you will also have to set the host value manually, but the host_segment lets you set this from the path being monitored.

Hope this helps,

Kristian

link

answered 06 Apr '12, 09:17

kristian.kolb's gravatar image

kristian.kolb
9.8k615
accept rate: 33%

This goes on the forwarder? Or should it be on the inputs.conf on the index?

(06 Apr '12, 09:29) nkitmitto

In the inputs file, I have this and it worked:

[monitor:///logs/static-httpd-error-log/*/*.log]
sourcetype = static-httpd-error-log
index = main
host_segment = 3

Thanks for the help!

link

answered 06 Apr '12, 09:43

nkitmitto's gravatar image

nkitmitto
615
accept rate: 0%

edited 06 Apr '12, 13:30

you are most welcome. /k

(06 Apr '12, 13:36) kristian.kolb
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:

×463
×247
×109
×26

Asked: 06 Apr '12, 08:59

Seen: 809 times

Last updated: 06 Apr '12, 13:36

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