omhttp: HTTP Output Module

Module Name: omhttp
Author: Christian Tramnitz

Warning

This page is incomplete, if you want to contribute you can do this on github in the rsyslog-doc repository.

Purpose

This module provides the opportunity to send messages over a REST interface.

Notable Features

Configuration Parameters

Note

Parameter names are case-insensitive.

Action Parameters

Server

type default mandatory obsolete legacy directive
array localhost no none

The server address you want to connect to.

Serverport

type default mandatory obsolete legacy directive
integer 443 no none

The port you want to connect to.

healthchecktimeout

type default mandatory obsolete legacy directive
integer 3500 no none

The time after which the health check will time out in milliseconds.

httpheaderkey

type default mandatory obsolete legacy directive
word none no none

The header key.

httpheadervalue

type default mandatory obsolete legacy directive
word none no none

The header value.

uid

type default mandatory obsolete legacy directive
word none no none

The username.

pwd

type default mandatory obsolete legacy directive
word none no none

The password for the user

restpath

type default mandatory obsolete legacy directive
word none no none

The rest path you want to use.

dynrestpath

type default mandatory obsolete legacy directive
binary off no none

When this parameter is set to “on” you can specify a template name in the parameter restpath instead of the actual path. This way you will be able to use dynamic rest paths for your messages based on the template you are using.

bulkmode

type default mandatory obsolete legacy directive
binary off no none

With this parameter you can activate bulk mode, which will gather messages and send them as one. How many messages are gathered can be specified in parameter maxbytes.

maxbytes

type default mandatory obsolete legacy directive
Size 10485760 (10MB) no none

This parameter specifies the max length of a bulk.

useHttps

type default mandatory obsolete legacy directive
binary off no none

When switched to “on” you will use https instead of http.

errorfile

type default mandatory obsolete legacy directive
word none no none

Here you can set the name of a file where all errors will be written to.

erroronly

type default mandatory obsolete legacy directive
binary off no none

interleaved

type default mandatory obsolete legacy directive
binary off no none

template

type default mandatory obsolete legacy directive
word StdJSONFmt no none

The template to be used for the messages.

Examples

Example 1

The following example is a basic usage, first the module is loaded and then the action is used.

template(name="tpl1" type="string" string="{\"type\":\"syslog\", \"host\":\"%HOSTNAME%\"}")
module(load="omhttp")
action(type="omhttp" server="127.0.0.1" serverport="8080" restpath="events"
       template="tpl1")

See also

Help with configuring/using Rsyslog:

  • Mailing list - best route for general questions
  • GitHub: rsyslog source project - detailed questions, reporting issues that are believed to be bugs with Rsyslog
  • Stack Exchange (View, Ask) - experimental support from rsyslog community

See also

Contributing to Rsyslog: