# Generate Syslog message when users login

**URL:** <https://community.f5.com/t/generate-syslog-message-when-users-login/59979>\
**Category:** Technical Forums\
**Tags:** big-ip-access-policy-manager-apm, security, application-delivery\
**Created:** [May 28, 2016, 11:43pm UTC](https://community.f5.com/t/generate-syslog-message-when-users-login/59979 "2016-05-28T23:43:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roflcopter](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Roflcopter](https://community.f5.com/u/Roflcopter)\
**Post date:** [May 28, 2016, 11:43pm UTC](https://community.f5.com/t/generate-syslog-message-when-users-login/59979/1 "2016-05-28T23:43:17Z")

</div>

We have a requirement that when a users logs in remotely a syslog message is generated containing the following -

Username: Device: IP: Country of origin:

Has anyone has any experience doing this?

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [May 29, 2016, 7:23am UTC](https://community.f5.com/t/generate-syslog-message-when-users-login/59979/2 "2016-05-29T07:23:37Z")

</div>

Hi,

What kind of authentication are talking about “system” or apm ?

For apm, you can use a email block in your vpe. The attributes you need can be found in variables of the apm session.

For system, you can deliver locally generated email but you will not able to include all required information : [404 Page not found | BIG-IP Documentation](https://support.f5.com/kb/en-us/solutions/public/13000/100/sol13180.html)

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@Yann\_Desmarest](https://community.f5.com/u/Yann_Desmarest)\
**Post date:** [May 29, 2016, 7:23am UTC](https://community.f5.com/t/generate-syslog-message-when-users-login/59979/3 "2016-05-29T07:23:37Z")

</div>

Hi,

What kind of authentication are talking about “system” or apm ?

For apm, you can use a email block in your vpe. The attributes you need can be found in variables of the apm session.

For system, you can deliver locally generated email but you will not able to include all required information : [404 Page not found | BIG-IP Documentation](https://support.f5.com/kb/en-us/solutions/public/13000/100/sol13180.html)

---

<div class="post-metadata">

**Author:** ![Roflcopter](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Roflcopter](https://community.f5.com/u/Roflcopter)\
**Post date:** [May 29, 2016, 7:50am UTC](https://community.f5.com/t/generate-syslog-message-when-users-login/59979/4 "2016-05-29T07:50:47Z")

</div>

This is via apm. We have users logging in using AD credentials.

---

<div class="post-metadata">

**Author:** ![Roflcopter](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Roflcopter](https://community.f5.com/u/Roflcopter)\
**Post date:** [May 29, 2016, 7:50am UTC](https://community.f5.com/t/generate-syslog-message-when-users-login/59979/5 "2016-05-29T07:50:47Z")

</div>

This is via apm. We have users logging in using AD credentials.

---

<div class="post-metadata">

**Author:** ![Yann\_Desmarest\_1](https://avatars.discourse-cdn.com/v4/letter/y/65b543/32.png) [@Yann\_Desmarest\_1](https://community.f5.com/u/Yann_Desmarest_1)\
**Post date:** [May 29, 2016, 8:20am UTC](https://community.f5.com/t/generate-syslog-message-when-users-login/59979/6 "2016-05-29T08:20:30Z")

</div>

Hi,

In the VPE, you can add a logging block (General Purpose) at the end of the policy with the following settings. This will be appended to the apm log :

```tcl
Log Message : Username:%{session.logon.last.username} Device:%{session.client.platform} IP:%{session.user.clientip} Country of origin: %{session.user.ipgeolocation.country_code}

```

You also have those information by default in the apm log :

```tcl
/Common/sp_ap:Common:e627e57f: Received User-Agent header: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36.
/Common/sp_ap:Common:e627e57f: New session from client IP 192.168.20.1 (ST=/CC=/C=) at VIP 192.168.20.222 Listener /Common/vs_test (Reputation=Unknown)

```
