# Logging MySQL query with username

**URL:** <https://discuss.elastic.co/t/logging-mysql-query-with-username/55400>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [July 13, 2016, 11:15am UTC](https://discuss.elastic.co/t/logging-mysql-query-with-username/55400 "2016-07-13T11:15:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChuyenGiaSon](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@ChuyenGiaSon](https://discuss.elastic.co/u/ChuyenGiaSon)\
**Post date:** [July 13, 2016, 11:15am UTC](https://discuss.elastic.co/t/logging-mysql-query-with-username/55400/1 "2016-07-13T11:15:37Z")

</div>

Hi, I see that packetbeat can log mysql query with performance data but not user name.  
It's not good because I want to use packetbeat for audit purpose.  
Can you tell me if packetbeat can log username along with the query ?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 13, 2016, 10:25pm UTC](https://discuss.elastic.co/t/logging-mysql-query-with-username/55400/2 "2016-07-13T22:25:01Z")

</div>

It does not capture the authentication messages so it does not know the active user for the connection making the queries.

---

<div class="post-metadata">

**Author:** ![ChuyenGiaSon](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@ChuyenGiaSon](https://discuss.elastic.co/u/ChuyenGiaSon)\
**Post date:** [July 14, 2016, 10:57am UTC](https://discuss.elastic.co/t/logging-mysql-query-with-username/55400/3 "2016-07-14T10:57:23Z")

</div>

So, I can not use this information for audit purpose ☹

---

<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 3, 2016, 11:15am UTC](https://discuss.elastic.co/t/logging-mysql-query-with-username/55400/4 "2016-08-03T11:15:39Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
