yoursearchhere
| rex "\son\s*(?<hostname>ncdap\S+)"
| stats count by hostname
should work. This will extract all of the hostnames in the log, if you replace the first line with a general query like sourcetype=ZZZZ where ZZZZ is the sourcetype of the data.
If you want to see the events, but only certain fields, you can do this
yoursearchhere
| rex "\son\s*(?<hostname>ncdap\S+)"
| table hostname
You could also filter like this
yoursearchhere
| rex "\son\s*(?<hostname>ncdap\S+)"
| where hostname="ncdap-prd1911" OR hostname="ncdap-prd1914"
| stats count by hostname
... View more