Skip to content

Instantly share code, notes, and snippets.

@jrwarwick
Created May 11, 2021 17:00
Show Gist options
  • Save jrwarwick/382938aab8f9d3f32769e427b3f9d85d to your computer and use it in GitHub Desktop.
Save jrwarwick/382938aab8f9d3f32769e427b3f9d85d to your computer and use it in GitHub Desktop.
Graylog Pipeline Rules - Active Directory summaries for a Technical Support Service Desk
rule "AD User Lockout event summarize"
when
has_field("winlogbeat_event_data_TargetUserName")
AND contains(to_string($message.winlogbeat_event_id), "4740")
then
//Build up and add a summary field
let summarized_message = concat(to_string($message.winlogbeat_event_data_TargetUserName), " locked out from domain ");
let summarized_message = concat(summarized_message, to_string($message.winlogbeat_event_data_SubjectDomainName));
let summarized_message = concat(summarized_message, "\n\n Reported from ");
let summarized_message = concat(summarized_message, to_string($message.source));
//Supplement
let supplemental = to_string($message.winlogbeat_event_data_TargetDomainName);
//fancier version//let supplemental = first_non_null( [ to_string($message.winlogbeat_event_data_TargetDomainName), "(unknown)" ] );
let summarized_message = concat(summarized_message, "\n Possibly implicated workstation/hostname: ");
let summarized_message = concat(summarized_message, to_string(supplemental));
//not needed for now//lookup_value("lookup_error", to_string($message.winlogbeat_event_data_SubStatus));
set_field("servicedesk_summary", to_string(summarized_message));
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment