Deployment Architecture

When trying to monitor two logs file formal from the same directory, why is it throwing an error: Parameters must be in the form '-parameter value'?

clementros
Path Finder

Hi,

I'm trying to monitor 2 logs file format (.out & .err) from a same directory (/var/splunkdata).

I use the CLI command to execute the add monitor command :

sudo /opt/splunkforwarder/bin/splunk add monitor /var/splunkdata/*.out -index nbtktfed -sourcetype NBTKTFED.out

This command generate the following result :

Parameters must be in the form '-parameter value'

I don't know what i'm doing wrong.

Any idea ?

0 Karma
1 Solution

nickhills
Ultra Champion

try:
./splunk add monitor -source "/var/splunkdata/*.out" -index nbtktfed -sourcetype "NBTKTFED.out"

If my comment helps, please give it a thumbs up!

View solution in original post

0 Karma

nickhills
Ultra Champion

try:
./splunk add monitor -source "/var/splunkdata/*.out" -index nbtktfed -sourcetype "NBTKTFED.out"

If my comment helps, please give it a thumbs up!
0 Karma

clementros
Path Finder

Thanks you !

0 Karma

nickhills
Ultra Champion

You're welcome -source is not mandatory but sometimes I have found it useful to specify it and "quote" the paths to make it clear to Splunk what you are trying to do.
Please upvote this answer to help others in the future!
All the best.

If my comment helps, please give it a thumbs up!
0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...