Hello, How do I "Left join" by appending CSV to an index in multiple fields? I was able to solve the problem, but 1) Is it possible to solve this problem without string manipulation and mvexpand? (see the code) Mvexpand caused slowness 2) Can "stats value" NOT remove the duplicate? In this case, stats values (*) as * by ip, it merged field "risk and "score" and removed the duplicates. My workaround is to combine the string to retain the duplicates. 3) a) Why does "stats value" ignore empty string? b) Why adding Null into non-null string will result empty? I have to use fillnull in order to retain the data. Please review the sample data, drawing and the code Thank you for your help.!! host.csv ip_address host 10.1.1.1 host1 10.1.1.2 host2 10.1.1.3 host3 10.1.1.4 host4 10.1.1.5 host5 10.1.1.6 host6 10.1.1.7 host7 index=risk ip risk score contact 10.1.1.1 riskA 6 10.1.1.1 riskB 7 10.1.1.1 person1 10.1.1.1 riskC 6 10.1.1.2 person2 10.1.1.3 riskA 6 person3 10.1.1.3 riskE 7 person3 10.1.1.4 riskF 8 person4 10.1.1.8 riskA 6 person8 10.1.1.9 riskB 7 person9 "Left join" expected output - yellow and green rectangle (see drawing below) ip host risk score contact 10.1.1.1 host1 riskA 6 10.1.1.1 host1 riskB 7 10.1.1.1 host1 person1 10.1.1.1 host1 riskC 6 10.1.1.2 host2 person2 10.1.1.3 host3 riskA 6 person3 10.1.1.3 host3 riskE 7 person3 10.1.1.4 host4 riskF 8 person4 10.1.1.5 host5 10.1.1.6 host6 10.1.1.7 host7 | makeresults format=csv data="ip_address, host
10.1.1.1, host1
10.1.1.2, host2
10.1.1.3, host3
10.1.1.4, host4
10.1.1.5, host5
10.1.1.6, host6
10.1.1.7, host7"
| eval source="csv"
| rename ip_address as ip
| append
[makeresults format=csv data="ip, risk, score, contact
10.1.1.1, riskA, 6, ,
10.1.1.1, riskB, 7 ,
10.1.1.1, ,, person1,
10.1.1.1, riskC, 6,,
10.1.1.2, ,, person2,
10.1.1.3, riskA, 6, person3,
10.1.1.3, riskE, 7, person3,
10.1.1.4, riskF, 8, person4,
10.1.1.8, riskA, 6, person8,
10.1.1.9, riskB, 7, person9"
| fillnull score value=0
| fillnull risk, score, contact value="N/A"
| eval source="index"]
| eval strmerged = risk + "," + score + "," + contact
| stats values(*) as * by ip
| mvexpand strmerged
| eval temp = split(strmerged,",")
| eval risk = mvindex(temp, 0)
| eval score = mvindex(temp, 1)
| eval contact = mvindex(temp, 2)
| search (source="csv" AND source="index") OR (source="csv")
| table ip, host, risk, score, contact
... View more