Heka Message Extensions for LPeg Modules

This module is intended to be used with another IO module such as a decoder to extend the message with additional transformations prior to injection.

1. Functions

1.1. add_normalized_user_agent

Given a Heka message add the normalized user agent entries based on the specified field name.

Arguments

  • msg (table) - original message
  • field_name (string) - field name in the message to lookup

Return

  • none - the message is modified in place or an error is thrown The added fields will have the same name as field_name with suffixes of "_browser", "_version" and "_os"

1.1.1. Configuration Options

lpeg_heka = {
    user_agent_normalized_field_name = "user_agent", -- set to override the original field name prefix
    user_agent_remove = true, -- remove the user agent field after a successful normalization
}

### set_(uuid|timestamp|logger|hostname|type|envversion|payload|severity|pid)

Set the specificed header to the field value and removes the field.

*Arguments*
- msg (table) - original message
- field_name (string) - field name in the message to lookup

*Return*
- none - the message is modified in place or an error is thrown

### remove_payload

Remove the `Payload` header which is set by default when using a grammar decoder.

*Arguments*
- msg (table) - original message
- field_name (string) - ignored

*Return*
- none - the message is modified in place or an error is thrown

source code: heka.lua

results matching ""

    No results matching ""