# User name and realm information in audit logs (user.name user.realm authentication\_success user.run\_by.name)

**URL:** <https://discuss.elastic.co/t/user-name-and-realm-information-in-audit-logs-user-name-user-realm-authentication-success-user-run-by-name/168606>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [February 15, 2019, 2:31pm UTC](https://discuss.elastic.co/t/user-name-and-realm-information-in-audit-logs-user-name-user-realm-authentication-success-user-run-by-name/168606 "2019-02-15T14:31:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Downey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_downey/32/35987_2.png) [@Ryan\_Downey](https://discuss.elastic.co/u/Ryan_Downey)\
**Post date:** [February 15, 2019, 2:31pm UTC](https://discuss.elastic.co/t/user-name-and-realm-information-in-audit-logs-user-name-user-realm-authentication-success-user-run-by-name/168606/1 "2019-02-15T14:31:18Z")

</div>

Elasticsearch 6.5.4  
Linux

I'm trying to fine tune our audit logs a bit and after logging our first audit logs I noticed that they dont provide us with some of the information we'd like. So we have two realms, native and SAML established and working, when I log in via SAML the logs only show "user.name":"\_xpack\_security", "user.realm":"\_\_attach" which isn't as detailed as we'd like. From what I can tell I need to implement authentication\_success: user.run\_by.name and realm but I'm having some trouble with how exactly thats supposed to be flatened out. Should it be something like:

```auto
xpack.security.audit.logfile.events.authentication_success: [user.run_by.name, realm]

```

I can't seem to get the syntax of this straightend out. Appreciate any help. Our current config is below.

```auto
xpack.security.audit.enabled: true
xpack.security.audit.outputs: [index, logfile]
xpack.security.audit.logfile.events.emit_request_body: true
xpack.security.audit.index.settings:
  index:
    number_of_shards: 3
    number_of_replicas: 2

```

---

<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:** [March 15, 2019, 2:31pm UTC](https://discuss.elastic.co/t/user-name-and-realm-information-in-audit-logs-user-name-user-realm-authentication-success-user-run-by-name/168606/2 "2019-03-15T14:31:18Z")

</div>

Closed on March 15, 2019, 2:31pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
