NxLog의 '그리고' 논리

NxLog의 '그리고' 논리

현재 로그인/로그아웃 이벤트를 가져오는 다양한 도메인 컨트롤러에서 NxLog를 실행하고 있습니다.

Exec if $TargetUserName =~ /(\S+\$|user1|user2|user3|user4)/ drop(); \
     else if ($EventID == 4624 or $EventID == 4625 or $EventID == 4648 or $EventID == 4768) $raw_event = "Time:" + $EventTime + ", EventID:" + $EventID + ", Keyword:" + $Status + ", LogonType:" + $LogonType + ", User:" + $TargetDomainName + "\\" + $TargetUserName + ", IPAddr:" + $IPAddress; \
     else if $raw_event =~ /^(.+)(Detailed Authentication Information:|Additional Information:)/ $raw_event = $1; if $raw_event =~ s/\t/  /g {}

위의 구성은 잘 작동하지만 $가 포함된 사용자 이름과 내가 지정한 사용자 이름도 무시한다는 점에서 해당 사용자 이름이 포함된 이벤트 ID 4624만 무시하여 실패한 로그인을 계속 볼 수 있도록 하고 싶습니다. 다음 구성이 작동할 것이라고 생각했지만 구문 오류가 계속 발생합니다.

Exec if ($EventID == 4624 and $TargetUserName =~ /(\S+\$|user1|user2|user3|user4)/ drop(); \
     else if ($EventID == 4624 or $EventID == 4625 or $EventID == 4648 or $EventID == 4768) $raw_event = "Time:" + $EventTime + ", EventID:" + $EventID + ", Keyword:" + $Status + ", LogonType:" + $LogonType + ", User:" + $TargetDomainName + "\\" + $TargetUserName + ", IPAddr:" + $IPAddress; \
     else if $raw_event =~ /^(.+)(Detailed Authentication Information:|Additional Information:)/ $raw_event = $1; if $raw_event =~ s/\t/  /g {}

어떤 도움이라도 대단히 감사하겠습니다.

편집하다:완벽함을 위해 다음은 $가 포함된 사용자 이름을 제외하고 내가 신경 쓰지 않는 수다스러운 다양한 계정의 성공/Kerb 이벤트를 제외하는 최종 구성입니다.

Exec if $TargetUserName =~ /(\S+\$)/ drop(); \
     else if ($EventID == 4624 and $TargetUserName =~ /(user1|user2|user3|user4)/) drop(); \
     else if ($EventID == 4648 and $TargetUserName =~ /(user1|user2|user3|user4)/) drop(); \
     else if ($EventID == 4624 or $EventID == 4625 or $EventID == 4648 or $EventID == 4768) $raw_event = "Time:" + $EventTime + ", EventID:" + $EventID + ", Keyword:" + $Status + ", LogonType:" + $LogonType + ", User:" + $TargetDomainName + "\\" + $TargetUserName + ", IPAddr:" + $IPAddress; \
     else if $raw_event =~ /^(.+)(Detailed Authentication Information:|Additional Information:)/ $raw_event = $1; if $raw_event =~ s/\t/  /g {}

답변1

구문 오류의 원인은 대괄호가 올바르게 쌍을 이루지 않았기 때문입니다. 다음과 같아야 합니다.

Exec if ($EventID == 4624 ... ) drop(); 
        ^                     ^

관련 정보