|
I'm trying to perform a seemingly simple task, which is to search for failed logins in my AD environment. Here's the search I used found in another Answer;
Great! I found some failed logins. Now I want specific information out of this event which is the "Account Name" of the user who's having a problem. Ewwww, but with Microsoft's lovely log format, they so graciously supply TWO "Account Name" fields with the same name;
I want that second occurrence of "Account Name" (which holds username). Now you may already be thinking, hey buddy this question has been asked before -- go search because the answers out there (one, two) are to use "| eval newVar=mvindex(Account_Name,1)"... ...but hear me out. It's not behaving as expected. So I adjust my search to store the 2nd occurrence of "Account Name" in a new variable and dump them into a table;
Here's the problem, this results in;
I can't get the value of the 2nd occurrence. Reading the documentation on Parse Fields With Multiple Values doesn't shed any light on my problem. So I tried grabbing the last value; "newVar=mvindex(Account_Name,-1)" but that outputs blank as well. So I start to question if mvindex is doing anything... ...but the strange thing is that this "newVar=mvindex(Account_Name,0)" seems to store/retrieve just fine despite it not being the data I want. Can someone point me in the right direction? Thanks in advance. Running 4.1.5 Linux x86_64 ziegfried Solution
|
|
How are you extracting the Account_Name field(s)?
added results of your query to the original post. sure wish there was a code tag function in comments. thanks for your help so far.
(17 Nov '10, 16:49)
pstraw
thank you bwooden! your rex helped.
(17 Nov '10, 19:21)
pstraw
|
|
An options is to extract the Account name after the ocurrence of "Account For Which Logon Failed":
wanted_account in the Results Table returns blank for this query.
(19 Nov '10, 18:48)
pstraw
I've forgot to add the multiline and dot-all flag to the regex. I've edited the search expression above.
(20 Nov '10, 14:18)
ziegfried ♦
your query is working now. edit to remove the stray
(20 Nov '10, 18:13)
pstraw
|
When you show Account_Name as an enabled field in the Event Viewer, do you get multiple occurrences of Account_Name or just 1 occurrence with the value being the 1st extraction (SERVERNAME$)?
Account_Name in the Events Table/View shows the 1st occurrence which typically is "-" or SERVERNAME$
I am correct in my understanding that the Events view/table, you can not display custom/new variables? Those will only display in the Results view/table?