Skip to content

Mapping hardware hostnames from syslogs to Datadog "hostname" attribute #9905

Answered by spencergilbert
lognarly asked this question in Q&A
Discussion options

You must be logged in to vote

Yes! The parse_syslog function will return an object like this:

{
  "appname": "non",
  "[email protected]": "1011",
  "[email protected]": "Application",
  "[email protected]": "3",
  "facility": "user",
  "hostname": "dynamicwireless.name",
  "message": "Try to override the THX port, maybe it will reboot the neural interface!",
  "msgid": "ID931",
  "procid": 2426,
  "severity": "notice",
  "timestamp": "2020-03-13T20:45:38.119Z",
  "version": 1
}

So for example your script could look something like this

. = parse_syslog!(.message) # replaces the original event with the parsed message field
.host = del(.hostname) # I think DD will use either host or hostname but …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lognarly
Comment options

@spencergilbert
Comment options

Answer selected by lognarly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants