# ES|QL Basic Help

**URL:** <https://discuss.elastic.co/t/es-ql-basic-help/383107>\
**Category:** Kibana\
**Tags:** esql\
**Created:** [October 30, 2025, 6:21pm UTC](https://discuss.elastic.co/t/es-ql-basic-help/383107 "2025-10-30T18:21:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)\
**Post date:** [October 30, 2025, 6:21pm UTC](https://discuss.elastic.co/t/es-ql-basic-help/383107/1 "2025-10-30T18:21:15Z")

</div>

Hello,

I did a `STATS count = COUNT_DISTINCT(event.outcome) by host.name`.  
And it works, the only issue I wish I could keep the metadata information about the host?  
Is there a way to do this??

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/0/000f302a3afc26d1c359f8afc73c95285bd116b4.png)
