Hi I have two saved searches lookup1 and lookup2 with line_id as common field ,
low will I join two results based on line_id.
Query I used is as follows:
| savedsearch "lookup2" | eval line_id=DDD.NUMERO_TERMINAL| eval FR=cd_enc
| eval str=substr(FR,2) |eval str1=substr(str,5)| eval str2=substr(str,1,len(str)-2)| eval str3=str2+str1 | table str3|rename str3 as ErrorCode | join line_id [| savedSearch "lookup1"] | table line_id,VendorID_FIELD4,ErrorCode.
Can correct my query to get results based on common line_id
Thanking,
I think you'll get better results by changing 'table str3|rename str3 as ErrorCode
' to 'rename str3 as ErrorCode | fields ErrorCode, line_id
'.
I think you'll get better results by changing 'table str3|rename str3 as ErrorCode
' to 'rename str3 as ErrorCode | fields ErrorCode, line_id
'.
Do you get any result with this ? [you should get results with two fields str3 and line_id]
| savedsearch "lookup2" | eval line_id=DDD.NUMERO_TERMINAL| eval FR=cd_enc | eval str=substr(FR,2) |eval str1=substr(str,5)| eval str2=substr(str,1,len(str)-2)| eval str3=str2+str1 | table str3, line_id|rename str3 as ErrorCode
Getting no results could mean one of your saved searched is not finding any events or the join command is not finding common events. Verify each command in the pipeline is passing fields needed by subsequent commands.
Getting no results found. . What might be the problem?
Yes, Once your submitted your "|table str3", all other fields were removed from result. Try this.
| savedsearch "lookup2" | eval line_id=DDD.NUMERO_TERMINAL| eval FR=cd_enc | eval str=substr(FR,2) |eval str1=substr(str,5)| eval str2=substr(str,1,len(str)-2)| eval str3=str2+str1 | table str3, line_id|rename str3 as ErrorCode | join line_id [| savedSearch "lookup1"] | table line_id,VendorID_FIELD4,ErrorCode