# Correlation of mem used and swap used

**URL:** <https://community.dynatrace.com/t/correlation-of-mem-used-and-swap-used/46024>\
**Category:** Alerting\
**Tags:** problems-classic\
**Created:** [June 10, 2024, 4:56pm UTC](https://community.dynatrace.com/t/correlation-of-mem-used-and-swap-used/46024 "2024-06-10T16:56:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SrikanthSamraj](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SrikanthSamraj](https://community.dynatrace.com/u/SrikanthSamraj)\
**Post date:** [June 10, 2024, 4:56pm UTC](https://community.dynatrace.com/t/correlation-of-mem-used-and-swap-used/46024/1 "2024-06-10T16:56:37Z")

</div>

Hi, there

Is it possible to create a metric event that encompasses both swap space usage and mem used for Linux systems?

I’m able to correlate both of them (swap used % and mem used %) in a single table but any help to convert them into a metric event would be of great help.

Is this something doable in Dynatrace?

Regards,

Srikanth

 ![Swap+Mem.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/2/7/27f7a06ab00cdc491d7852c0e4113c8d6e6766a2.jpeg)

---

<div class="post-metadata">

**Author:** ![jaume\_reverte](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jaume_reverte/32/1479_2.png) [@jaume\_reverte](https://community.dynatrace.com/u/jaume_reverte)\
**Post date:** [August 28, 2024, 7:46am UTC](https://community.dynatrace.com/t/correlation-of-mem-used-and-swap-used/46024/2 "2024-08-28T07:46:31Z")

</div>

Hello&nbsp;SrikanthSamraj,

Can you send us the metric you’re using to check the Swap used %?

If you can correlate them inside a table, then putting them as metric events should be easy. You need to use an arithmetic function using the two metrics inside the metric selector of event metric settings.

---

<div class="post-metadata">

**Author:** ![SrikanthSamraj](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SrikanthSamraj](https://community.dynatrace.com/u/SrikanthSamraj)\
**Post date:** [August 28, 2024, 9:33am UTC](https://community.dynatrace.com/t/correlation-of-mem-used-and-swap-used/46024/3 "2024-08-28T09:33:52Z")

</div>

Hi&nbsp;[@jaume\_reverte](https://community.dynatrace.com/user/55596),

Here is it,

Query definition type: Metric selector

Metric selector:

builtin:host.mem.swap.used:filter(and(or(in(“dt.entity.host”,entitySelector(“type(host),tag(~”[Environment]xxx:xxx~“),tag(~”[Environment]xxx:xxx~“),tag(~“xxx:xxx~”),tag(~“xxx:xxx~”)”)))))

/

builtin:host.mem.swap.total:filter(and(or(in(“dt.entity.host”,entitySelector(“type(host),tag(~”[Environment]xxx:xxx~“),tag(~”[Environment]xxx:xxx~“),tag(~“xxx:xxx~”),tag(~“xxx:xxx~”)”)))))

\*100

How do you correlate this with OOTB infrastructure problem “Memory saturation”?

---

<div class="post-metadata">

**Author:** ![Gosia\_Murawska](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@Gosia\_Murawska](https://community.dynatrace.com/u/Gosia_Murawska)\
**Post date:** [December 17, 2024, 9:23am UTC](https://community.dynatrace.com/t/correlation-of-mem-used-and-swap-used/46024/4 "2024-12-17T09:23:48Z")

</div>

Hi&nbsp;[@SrikanthSamraj](https://community.dynatrace.com/user/58568),&nbsp;did you manage to solve this one? It would be great if you share it with the Community 🚀

---

<div class="post-metadata">

**Author:** ![SrikanthSamraj](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@SrikanthSamraj](https://community.dynatrace.com/u/SrikanthSamraj)\
**Post date:** [December 17, 2024, 11:04am UTC](https://community.dynatrace.com/t/correlation-of-mem-used-and-swap-used/46024/5 "2024-12-17T11:04:46Z")

</div>

Hi&nbsp;[@GosiaMurawska](https://community.dynatrace.com/user/77704),&nbsp;not yet.
