@yuanliu , TransactionID is not present in both source types as well. The common thing in both source types is the USERID, however, they are renamed differently in both source types. Hence, we had to create a field USER to put all the users inside that field. Common things in both source types are USERID, USERCODES, REMARKS and all 3 of these fields are renamed differently in both source types. Other than the above mentioned fields, there is nothing common in both the source types. I need results to be close to this format: index=myindex (sourcetype="mysourcetypeA" OR sourcetype=mysouretypeB)
| foreach USERID_X USERID_Y USERID_Z
[eval USER = if(isnull(<<FIELD>>), USER, <<FIELD>>)
| eval "IP OF <<FIELD>>" = IP]
| stats values(USER) as USER values(USERID_X) as USERID_X values(eval('IP OF USERID_X')) as "IP OF USERID_X" values(USERID_Y) as USERID_Y values(eval('IP OF USERID_Y')) as "IP OF USERID_Y" values(USERID_Z) as USERID_Z values(eval('IP OF USERID_Z')) as "IP OF USERID_Z" by transactionID But I need information to be picked correctly for each user. What is happening with the above query is as below: USER USERID_X IP OF USERID_X USERID_Y IP OF USERID_Y USERID_Z IP OF USERID_Z BEATRICE 10.10.10.1 10.10.10.1 10.10.10.1 ARTHUR JANE 10.10.10.3 ARTHUR 10.10.10.3 ARTHUR 10.10.10.3 Beatrice's IP is correct. Now, ideally, I should see the IP address of Jane under IP OF USERID_X, which should be 10.10.10.4, but it is picking the IP OF USERID_Y who is Arthur and whose IP is 10.10.10.3 instead, because I have grouped BY USER and not BY TRANSACTIONID as it was not common in both source types. When I analyze my data and look for Jane and Arthur separately, the users do not have the same IP address and Jane has never used Arthur's IP address. Correct me if I am wrong, when we use the command | foreach USER_ID, USERID_X, USERID_Y, USERID_Z are we trying to combine the information for all these into 1 one common field called USER? (I have never used the | foreach command before, hence, the question) Something I've realized is that the information of users, can only be the same for: USER, USERID_X and USERID_Y or USER, USERID_Y and USERID_Z or USER, USERID_X and USERID_Z At no given point are all 4 of these i.e. USER, X, Y and Z picking the same users at the same time. Maybe that's why the IP address is only picked for the user where the information is the same and leaves the IP address of the one where the user is different?
... View more