# Kibana alerts with cusotm fields

**URL:** <https://discuss.elastic.co/t/kibana-alerts-with-cusotm-fields/363523>\
**Category:** Elastic Security\
**Created:** [July 22, 2024, 6:53am UTC](https://discuss.elastic.co/t/kibana-alerts-with-cusotm-fields/363523 "2024-07-22T06:53:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marek\_Galbavy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marek_galbavy/32/132943_2.png) [@Marek\_Galbavy](https://discuss.elastic.co/u/Marek_Galbavy)\
**Post date:** [July 22, 2024, 6:53am UTC](https://discuss.elastic.co/t/kibana-alerts-with-cusotm-fields/363523/1 "2024-07-22T06:53:23Z")

</div>

Hi i try to create custom rule which find communication for more than 250 destination.ports. My problem is when the alert is created i dont have information which ports was in this communication.

this is my ESQL  
from logs-network\_traffic.\*

```auto
| where CIDR_MATCH(source.ip,"10.0.0.0/8") or CIDR_MATCH(source.ip, "172.16.0.0/12") OR CIDR_MATCH(source.ip, "192.168.0.0/16")

| stats unique_ports = count_distinct(destination.port), ports = values(destination.port) by source.ip

| where unique_ports > 250

```

i have in alert field unique\_ports with total count thats great but i cant see particular ports. funkction values doestn work .

The same problem i have in other alerts. How can i write query/alert with information which i wont?

---

<div class="post-metadata">

**Author:** ![nikitaindik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikitaindik/32/132780_2.png) [@nikitaindik](https://discuss.elastic.co/u/nikitaindik)\
**Post date:** [August 5, 2024, 1:36pm UTC](https://discuss.elastic.co/t/kibana-alerts-with-cusotm-fields/363523/2 "2024-08-05T13:36:09Z")

</div>

Hi @Marek_Galbavy! I have tried your ES|QL query locally and it seems to work fine for me. I was able to find the port values in the "ports" field of the generated alert. Which version of Kibana are you using?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 2, 2024, 1:36pm UTC](https://discuss.elastic.co/t/kibana-alerts-with-cusotm-fields/363523/3 "2024-09-02T13:36:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
