<commit_before>{% if servers|length != 0 %}
module(load="imfile")
{% if accumulator is defined %}
{% for application_name, application in accumulator|dictsort() %}
{% set name = application_name|replace('-log', '') %}
{% for file in application[0].files %}
{% if file.tag is defined %}
{% set identifier = name + '-' + file.tag %}
{% else %}
{% set identifier = name %}
{% endif %}

# application: {{ name }} --- file: {{ file.path }}

template(name="{{ identifier }}-json" type="list") {
    constant(value="{")
        constant(value="\"logtype\":\"")          constant(value="application")
        constant(value="\",\"application\":\"")   constant(value="{{ identifier }}")
        constant(value="\",\"content\":{")
            constant(value="\"message\":\"")      property(name="msg" format="json")
        constant(value="\"}")
        constant(value=",\"hostinfo\":{")
            constant(value="\"hostname\":\"")     property(name="$myhostname")
        constant(value="\"}")
    constant(value="}")
}

ruleset(name="forward-{{ identifier }}") {
{% for server in servers %}<commit_msg>rsyslog: Enable optional simpler logfile specification.<commit_after>{% if servers|length != 0 %}
module(load="imfile")
{% if accumulator is defined %}
{% for application_name, application in accumulator|dictsort() %}
{% set name = application_name|replace('-log', '') %}

{% set application = application[0] %}
{% if application.files is defined %}
{% set files = application.files %}
{% else %}
{% set files = [{'path': application.file}] %}
{% endif %}

{% for file in files %}
{% if file.tag is defined %}
{% set identifier = name + '-' + file.tag %}
{% else %}
{% set identifier = name %}
{% endif %}

# application: {{ name }} --- file: {{ file.path }}

template(name="{{ identifier }}-json" type="list") {
    constant(value="{")
        constant(value="\"logtype\":\"")          constant(value="application")
        constant(value="\",\"application\":\"")   constant(value="{{ identifier }}")
        constant(value="\",\"content\":{")
            constant(value="\"message\":\"")      property(name="msg" format="json")
        constant(value="\"}")
        constant(value=",\"hostinfo\":{")
            constant(value="\"hostname\":\"")     property(name="$myhostname")
        constant(value="\"}")
    constant(value="}")
}

ruleset(name="forward-{{ identifier }}") {
{% for server in servers %}
{'fraction_non_alphanumeric': 0.22795341098169716, 'fraction_numerical': 0.0016638935108153079, 'mean_word_length': 3.6608527131782944, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, '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': '5203979', 'n_tokens_mistral': 726, 'n_tokens_neox': 669, 'n_words': 149}