You can use mvexpand command for your use-case as shown below..
| makeresults
| eval message=" {
\"target\":[
{
\"detailEntry\":{
\"signOnModeType\":\"dummy info\"
},
\"alternateId\":\"AppName1\",
\"displayName\":\"dummy info\",
\"id\":\"dummy info\",
\"type\":\"AppInstance\"
},
{
\"detailEntry\":null,
\"alternateId\":\"
[email protected]\",
\"displayName\":\"dummy info for email\",
\"id\":\"dummy info\",
\"type\":\"AppUser\"
}
]}"
| spath input=message
| eval _time=now()
| rename target{}.alternateId as appId
| mvexpand appId
| fields appId, _time
| regex appId!="([a-z0-9][-a-z0-9_\+\.]*[a-zA-Z0-9])@([a-zA-Z0-9][-a-zA-Z0-9\.]*[a-zA-Z0-9]\.(ca|com|org|net)|([0-9]{1,3}\.{3}[0-9]{1,3}))"
| timechart count by appId usenull=f limit=5 useother=f
As per your query, the RegEx was not working with timechart command as there are multi-values in the appId field. The mvexpand command expands the values of a multivalue field into separate events and the your can use the regex to filter events.
... View more