Refine your search:

When i try to train splunk to automatically recognize files of a given type, I get the following:

# $SPLUNK_HOME/bin/splunk train sourcetype /tmp/maillog qmail_maillog
errror:    Parameters must be in the form '-parameter value'

Am I doing this wrong? Is there a workaround?

asked 14 Jun '10, 19:32

jrodman's gravatar image

jrodman ♦
5.8k2515
accept rate: 42%


One Answer:

Firstly, for many cases, applying sourcetypes by file pattern can be preferable to content-based recognition. The file pattern rules are easier to audit. This can be done via overlapping input stanzas (in 4.1+), or by source:: regex-like patterns in props.conf.

If you do have the need to apply sourcetypes by content, then the train command is busted (SPL-31078), but it's just a candy wrapper over the following, which you can use directly for full effect:

$SPLUNK_HOME/bin/splunk cmd classify path/to/myfile mysourcetype 

If you're trying to use train to recognize timestamps, I generally recommend using TIME_FORMAT instead.

link

answered 14 Jun '10, 19:36

jrodman's gravatar image

jrodman ♦
5.8k2515
accept rate: 42%

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:

×154
×3

Asked: 14 Jun '10, 19:32

Seen: 838 times

Last updated: 14 Jun '10, 19:36

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