# Including some extra data in Audit record

**URL:** https://forums.percona.com/t/including-some-extra-data-in-audit-record/18401
**Category:** Percona Server for MySQL 8.0
**Created:** [November 7, 2022, 10:26am UTC](https://forums.percona.com/t/including-some-extra-data-in-audit-record/18401 "2022-11-07T10:26:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jovan\_Perovic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jovan_perovic/32/8265_2.png) [@Jovan\_Perovic](https://forums.percona.com/u/Jovan_Perovic)
#### Post date: [November 7, 2022, 10:26am UTC](https://forums.percona.com/t/including-some-extra-data-in-audit-record/18401/1 "2022-11-07T10:26:54Z")

</div>

Hi, I am looking into how the Audit plugin works. The thing I need is to include some connection variables in an audit record.

Use case:

- User attempts to login into my web app
- When a connection is established, if a user was authenticated, I execute the `SET APP_USER = 'user@domain.com'`
- I want to be able to audit all CRUD operations the user can do
- Naturally, my web app uses single DB user `web`, but I need that `APP_USER` variable inside my audit log

Does this make sense?

Thanks!

---

<div class="post-metadata">

### Author: ![CTutte](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ctutte/32/1341_2.png) [@CTutte](https://forums.percona.com/u/CTutte)
#### Post date: [November 7, 2022, 12:58pm UTC](https://forums.percona.com/t/including-some-extra-data-in-audit-record/18401/2 "2022-11-07T12:58:31Z")

</div>

Hi Jovan,

Why do you need to set “APP\_USER = X”? Is it because the app connects to the DB with a generic user and you need to differentiate each user?

Currently audit log does log every CRUD (and every other operation) and prints user@host that executed it, but no way of printing any extra details or status variables other than what it currently prints.

I suggest you open a feature request on our JIRA [https://jira.percona.com/projects/PS/issues/PS-8454?filter=allopenissues](https://jira.percona.com/projects/PS/issues/PS-8454?filter=allopenissues) and explain your use case and how the procedure would work and the development team will evaluate adding the feature in the future

Regards

---

<div class="post-metadata">

### Author: ![Jovan\_Perovic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jovan_perovic/32/8265_2.png) [@Jovan\_Perovic](https://forums.percona.com/u/Jovan_Perovic)
#### Post date: [November 7, 2022, 3:40pm UTC](https://forums.percona.com/t/including-some-extra-data-in-audit-record/18401/3 "2022-11-07T15:40:18Z")

</div>

Hey Carlos,

Yes, that is the exact goal I wanted to achieve - use one generic DB user but keep a record of actions every application user executed.

Thanks, I am going to open a feature request and hope for the best 🙂 🤞

Best regards,  
Jovan
