Hi!
I would like to separate the field Privilegio
|---------------------------|-------------------------------------------------------------------------------------------|-------------|
| src_user | Privilegio | count |
|---------------------------|-------------------------------------------------------------------------------------------|-------------|
| user-RAC0308$ | SeSecurityPrivilege | 8127 |
| | SeBackupPrivilege | |
| | SeRestorePrivilege | |
| | SeTakeOwnershipPrivilege | |
| | SeDebugPrivilege | |
| | SeSystemEnvironmentPrivilege | |
| | SeLoadDriverPrivilege | |
| | SeImpersonatePrivilege | |
| | SeDelegateSessionUserImpersonatePrivilege | |
| | SeEnableDelegationPrivilege | |
| | SeCreateTokenPrivilege | |
| | SeAssignPrimaryTokenPrivilege | |
|---------------------------|--------------------------------------------------------------------------------------------|--------------|
Since it only counts the first value and the others are put with a tab, they are the windows privileges of the EventID 4672, my query is the following:
index=oswinsec EventCode=4672
| stats values(PrivilegeList) as Privilegio count by src_user
Does this help?
index=oswinsec EventCode=4672
| stats count by src_user PrivilegeList
In that case, you need to split PrivilegeList first.
index=oswinsec EventCode=4672
| eval PrivilegeList = split(PrivilegeList, "
") ``` include the proper indentation characcter(s) ```
| eval SeSecurityPrivilege = mvindex(PrivilegeList, 1, mvcount(PrivilegeList))
``` the first line, SeSecurityPrivilege, is a mere header ```
| stats values(SeSecurityPrivilege) as Privilegio count by src_user