# From Splunk to ELK: how to perform statistic searches?

**URL:** https://discuss.elastic.co/t/from-splunk-to-elk-how-to-perform-statistic-searches/277644
**Category:** Elasticsearch
**Created:** [July 2, 2021, 12:33pm UTC](https://discuss.elastic.co/t/from-splunk-to-elk-how-to-perform-statistic-searches/277644 "2021-07-02T12:33:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Wooden\_tree](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@Wooden\_tree](https://discuss.elastic.co/u/Wooden_tree)
#### Post date: [July 2, 2021, 12:33pm UTC](https://discuss.elastic.co/t/from-splunk-to-elk-how-to-perform-statistic-searches/277644/1 "2021-07-02T12:33:06Z")

</div>

Hi,

I spent last few years with Splunk and now I’m an ELK user. I’d like to know if there is a way to perform a statistical search in ELK.

Let’s say, I have some firewall logs and I’d like to use it to detect a port scan behaviour. Here’s the query I’ll use in Splunk:

```auto
index=my_firewall_index

| stats dc(dest_port) as unequal_dest_port by source_ip

| where unequal_dest_port > 50

```

Could you please provide an ELK equivalent for this search?

Thanks.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [July 6, 2021, 2:04am UTC](https://discuss.elastic.co/t/from-splunk-to-elk-how-to-perform-statistic-searches/277644/2 "2021-07-06T02:04:19Z")

</div>

Welcome to our community! 😃

You'd build a visualisation, aggregating on the `source_ip` field and then running a count metric on the `dest_port` field. Then add a filter for `dest_port > 50`

---

<div class="post-metadata">

### Author: ![Wooden\_tree](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@Wooden\_tree](https://discuss.elastic.co/u/Wooden_tree)
#### Post date: [July 9, 2021, 1:13pm UTC](https://discuss.elastic.co/t/from-splunk-to-elk-how-to-perform-statistic-searches/277644/3 "2021-07-09T13:13:59Z")

</div>

Sounds not that difficult 🙂 I'll try it.  
Thanks for the help!

---

<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: [August 6, 2021, 1:14pm UTC](https://discuss.elastic.co/t/from-splunk-to-elk-how-to-perform-statistic-searches/277644/4 "2021-08-06T13:14:26Z")

</div>

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