<commit_before>
## Setup Kafka output
@load Bro/Kafka/logs-to-kafka

redef Kafka::topic_name = "bro_raw";
redef Kafka::json_timestamps = JSON::TS_ISO8601;
redef Kafka::tag_json = F;

## Setup event extension to include sensor and probe name
type Extension: record {
    ## The name of the system that wrote this log. This
    ## is defined in the  const so that
    ## a system running lots of processes can give the
    ## same value for any process that writes a log.
    system:   string &log;
    ## The name of the process that wrote the log. In
    ## clusters, this will typically be the name of the
    ## worker that wrote the log.
    proc:     string &log;
};

function add_log_extension(path: string): Extension
{
    return Extension($system = ROCK::sensor_id,
                     $proc   = peer_description);
}

redef Log::default_ext_func   = add_log_extension;
redef Log::default_ext_prefix = "@";
redef Log::default_scope_sep  = "_";
<commit_msg>Changed kafka topic name to use hyphen<commit_after>
## Setup Kafka output
@load Bro/Kafka/logs-to-kafka

redef Kafka::topic_name = "bro-raw";
redef Kafka::json_timestamps = JSON::TS_ISO8601;
redef Kafka::tag_json = F;

## Setup event extension to include sensor and probe name
type Extension: record {
    ## The name of the system that wrote this log. This
    ## is defined in the  const so that
    ## a system running lots of processes can give the
    ## same value for any process that writes a log.
    system:   string &log;
    ## The name of the process that wrote the log. In
    ## clusters, this will typically be the name of the
    ## worker that wrote the log.
    proc:     string &log;
};

function add_log_extension(path: string): Extension
{
    return Extension($system = ROCK::sensor_id,
                     $proc   = peer_description);
}

redef Log::default_ext_func   = add_log_extension;
redef Log::default_ext_prefix = "@";
redef Log::default_scope_sep  = "_";

{'fraction_non_alphanumeric': 0.09267793138760881, 'fraction_numerical': 0.00409626216077829, 'mean_word_length': 3.440909090909091, 'pattern_counts': {'":': 0, '<': 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': '760813', 'n_tokens_mistral': 593, 'n_tokens_neox': 586, 'n_words': 222}