# Script state ph2 peer ipsec

**URL:** <https://forum.mikrotik.com/t/script-state-ph2-peer-ipsec/166789>\
**Category:** Scripting\
**Created:** [May 18, 2023, 6:49pm UTC](https://forum.mikrotik.com/t/script-state-ph2-peer-ipsec/166789 "2023-05-18T18:49:17Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![abbio90](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/abbio90/32/2852_2.png) [@abbio90](https://forum.mikrotik.com/u/abbio90)\
**Post date:** [May 23, 2023, 10:20pm UTC](https://forum.mikrotik.com/t/script-state-ph2-peer-ipsec/166789/12 "2023-05-23T22:20:11Z")

</div>

:if ($CurrentStatusEdok != $LastStatusEdok) do={  
:set keepOutput true  
:set output ($LastStatusEdok)  
/log warning “STATO PEER EDOK=$CurrentStatusEdok”  
}

where am i wrong here? how do i set the parameter to the global variable?

---

_[View the full topic](https://forum.mikrotik.com/t/script-state-ph2-peer-ipsec/166789)._
