<commit_before>omhiredis: Redis Output Module
==============================

**Module Name:** omhiredis

**Original Author:** <NAME> <<EMAIL>>

**Description**

This module provides native support for writing to Redis, 
using the hiredis client library.

**Action Parameters**

- **server**
  Name or address of the Redis server

- **serverport**
  Port of the Redis server if the server is not listening on the default port.

- **mode**
  Mode to run the output action in: "template", "queue" or "publish".

- **template**
  Template is required if using "template" mode. 

- **key**
  Key is required if using "publish" or "queue" mode.


**Examples**

*Mode: template*

In "template" mode, the string constructed by the template is sent
to Redis as a command. Note this mode has problems with strings
with spaces in them - full message won't work correctly.

::
  module(load="omhiredis")

  template(
    name="program_count_tmpl"
    type="string"
    string="HINCRBY progcount %programname% 1")

  action(
    name="count_programs"
    server="my-redis-server.example.com"
    port="6379"
    type="omhiredis"
    mode="template"
    template="program_count_tmpl")

*Mode: queue*

In "queue" mode, the syslog message is pushed into a Redis list
at "key", using the LPUSH command. If a template is not supplied,
the plugin will default to the RSYSLOG_ForwardFormat template.

::
  module(load="omhiredis")

  action(
    name="push_redis"
    server="my-redis-server.example.com"
    port="6379"<commit_msg>omhiredis docs - call out requirement of template in template mode<commit_after>omhiredis: Redis Output Module
==============================

**Module Name:** omhiredis

**Original Author:** <NAME> <<EMAIL>>

**Description**

This module provides native support for writing to Redis, 
using the hiredis client library.

**Action Parameters**

- **server**
  Name or address of the Redis server

- **serverport**
  Port of the Redis server if the server is not listening on the default port.

- **mode**
  Mode to run the output action in: "template", "queue" or "publish".

- **template**
  Template is required if using "template" mode. 

- **key**
  Key is required if using "publish" or "queue" mode.


**Examples**

*Mode: template*

In "template" mode, the string constructed by the template is sent
to Redis as a command. Note this mode has problems with strings
with spaces in them - full message won't work correctly. In this
mode, the template argument is required, and the key argument
is meaningless.

::
  module(load="omhiredis")

  template(
    name="program_count_tmpl"
    type="string"
    string="HINCRBY progcount %programname% 1")

  action(
    name="count_programs"
    server="my-redis-server.example.com"
    port="6379"
    type="omhiredis"
    mode="template"
    template="program_count_tmpl")

*Mode: queue*

In "queue" mode, the syslog message is pushed into a Redis list
at "key", using the LPUSH command. If a template is not supplied,
the plugin will default to the RSYSLOG_ForwardFormat template.

::
  module(load="omhiredis")

  action(
    name="push_redis"
    server="my-redis-server.example.com"
    port="6379"
{'fraction_non_alphanumeric': 0.12385466034755134, 'fraction_numerical': 0.005687203791469194, 'mean_word_length': 4.164763458401305, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6975605', 'n_tokens_mistral': 983, 'n_tokens_neox': 950, 'n_words': 364}