You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please include this use-case, or one like it, as part of the liblognorm examples documentation. If there is a more eloquent manner to express this rule base, please let me know.
Overview
This example details a use-case for liblognorm’s alternative syntax. The use-case is applied to inconsistent preambles for syslog messages. Through the use of alternative syntax, users can create API-style message syntax type[s] which allow for a consistent and succinct parser interface.
2019-02-28T17:56:24+00:00 1.1.1.1 : %ASA-6-106015: Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface
2019-02-28T17:56:24+00:00 1.1.1.1 %ASA-6-106015: Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface
%ASA-6-106015: Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface
%ASA-6-106015: Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface
version=2
#===============================================================================
# File: parsers/parser_cisco-asa.rulebase
#
# Description:
# This rulebase is intended to provide common support parser[s] for cisco-asa
# syslog messages.
#
# Revision:
# 7:18 AM Saturday, March 9, 2019
#===============================================================================
#===============================================================================
# Includes
# Set the <project directory> tag to an appropriate value.
#===============================================================================
include=<project directory>/types/type_cisco-asa-support.rulebase
prefix=%[{ "type" : "@MSG_PREFIX", "name" : "." }]%
#===============================================================================
# Rules
#===============================================================================
rule=cisco,asa,example,alternative:%[
{ "type" : "rest", "name" : "_unparsed_data" }
]%
#===============================================================================
# END OF FILE
#===============================================================================
Output
cat ./logs/t_test.log | lognormalizer -THU -r ./parsers/parser_cisco-asa.rulebase | jq
4 records processed, 4 parsed, 0 unparsed
{
"_unparsed_data": " Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface",
"message_id": "106015",
"log_level": "6",
"product": "ASA",
"from_host": "1.1.1.1",
"timestamp": "2019-02-28T17:56:24+00:00",
"event.tags": [
"cisco",
"asa",
"example",
"alternative"
]
}
{
"_unparsed_data": " Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface",
"message_id": "106015",
"log_level": "6",
"product": "ASA",
"from_host": "1.1.1.1",
"timestamp": "2019-02-28T17:56:24+00:00",
"event.tags": [
"cisco",
"asa",
"example",
"alternative"
]
}
{
"_unparsed_data": " Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface",
"message_id": "106015",
"log_level": "6",
"product": "ASA",
"event.tags": [
"cisco",
"asa",
"example",
"alternative"
]
}
{
"_unparsed_data": " Deny TCP (no connection) from 2.2.2.2/49162 to 1.1.1.1/22 flags FIN ACK on interface my-interface",
"message_id": "106015",
"log_level": "6",
"product": "ASA",
"event.tags": [
"cisco",
"asa",
"example",
"alternative"
]
}
The text was updated successfully, but these errors were encountered:
Just wanted to say this was immensely useful to me in constructing some complex user-defined types and alternative parsers I could not figure out how to define otherwise. The documentation for both is rather uncreative with its examples, so thank you for publishing this!
Please include this use-case, or one like it, as part of the
liblognorm
examples documentation. If there is a more eloquent manner to express this rule base, please let me know.Overview
This example details a use-case for liblognorm’s alternative syntax. The use-case is applied to inconsistent preambles for syslog messages. Through the use of alternative syntax, users can create API-style message syntax type[s] which allow for a consistent and succinct parser interface.
How-To
Versioning
Directory Structure
Input File
Formats
Raw Message ($rawmsg)
Message ($msg):
Data
Type File
Parser File
Output
The text was updated successfully, but these errors were encountered: