Refine your search:

There must be an easy way to fire a single message over UDP to a splunk forwarder/server. "logger" nearly does it. I want to do something like this:

testlogger -h host -p port "message to log in Splunk"

Let me specify- Unix commandline. I suppose I could write a few lines of code, but am I the first person to want this?

asked 28 Sep '10, 18:02

tedder's gravatar image

tedder
2298
accept rate: 25%


One Answer:

You can use netcat for this purpose:

echo "message to log in Splunk" | nc -u -q 0 <HOST> <PORT>

Example:

echo "message to log in Splunk" | nc -u -q 0 localhost 514

(This works on Linux)


On a Mac, you have to use the -w option instead of -q

echo "message to log in Splunk" | nc -u -w 0 splunkhost.mydomain.com 514

Maybe the netcat command is different on other *nix systems as well.

link

answered 28 Sep '10, 18:18

ziegfried's gravatar image

ziegfried ♦
7.2k1315
accept rate: 53%

edited 28 Sep '10, 18:24

thanks! That's exactly what I was looking for.

(28 Sep '10, 18:28) tedder
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:

×88
×11

Asked: 28 Sep '10, 18:02

Seen: 657 times

Last updated: 28 Sep '10, 18:24

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