# Copyright (c) 2014 Flowerfire, Inc. All Rights Reserved. unix_sudo = { plugin_version = "1.0" info.1.manufacturer = "UNIX" info.1.device = "sudo" # 2014-06-03 - 1.0 - GMF - Initiali creation # The name of the log format log.format.format_label = "Unix Sudo Log Format" log.miscellaneous.log_data_type = "other" log.miscellaneous.log_format_type = "other" # The log is in this format if any of the first ten lines match this regular expression log.format.autodetect_regular_expression = `^[A-Z][a-z][a-z] [0-9 ][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] : [^ ]+ : HOST=` # All log field parsing will be done using the parsing filters log.format.parse_only_with_filters = "true" # Log fields log.fields = { date = "" time = "" username = "" host = "" message = "" tty = "" pwd = "" user = "" command = "" events = "" } # log.fields log.filter_initialization = ` string next_line = ""; string this_line = ""; ` # Log Parsing Filters log.parsing_filters.parse = ` # Accept an event when we see the start of the next event if (matches_regular_expression(current_log_line(), '^([A-Z].*)')) then ( next_line = $1; if (matches_regular_expression(this_line, '^([A-Z][a-z][a-z] [0-9 ][0-9]) ([0-9][0-9]:[0-9][0-9]:[0-9][0-9]) : ([^ ]+) : HOST=([^ ]+) : ([^;]+) ; TTY=([^ ]+) ; PWD=([^ ]+) ; USER=([^ ]+) ; COMMAND=(.*)$')) then ( set_collected_field('', 'date', normalize_date($1, 'mmm dd')); set_collected_field('', 'time', $2); set_collected_field('', 'username', $3); set_collected_field('', 'host', $4); set_collected_field('', 'message', $5); set_collected_field('', 'tty', $6); set_collected_field('', 'pwd', $7); set_collected_field('', 'user', $8); set_collected_field('', 'command', $9); accept_collected_entry('', false); ); this_line = next_line; ); else if (matches_regular_expression(current_log_line(), '^ ( .*)$')) then this_line .= $1; ` # Database fields database.fields = { date_time = "" day_of_week = "" hour_of_day = "" username = "" host = "" message = "" tty = "" pwd = "" user = "" command = "" } # database.fields database.numerical_fields = { events = { default = true requires_log_field = false entries_field = true } # events } # database.numerical_fields log.filters = { mark_entry = { label = '$lang_admin.log_filters.mark_entry_label' comment = '$lang_admin.log_filters.mark_entry_comment' value = 'events = 1;' } # mark_entry } # log.filters create_profile_wizard_options = { # How the reports should be grouped in the report menu report_groups = { date_time_group = "" } # report_groups } # create_profile_wizard_options } # unix_sudo