# Is there any way to get application logged in user id in Logstash input statement configuration

**URL:** https://discuss.elastic.co/t/is-there-any-way-to-get-application-logged-in-user-id-in-logstash-input-statement-configuration/219513
**Category:** Logstash
**Created:** [February 16, 2020, 10:32am UTC](https://discuss.elastic.co/t/is-there-any-way-to-get-application-logged-in-user-id-in-logstash-input-statement-configuration/219513 "2020-02-16T10:32:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![riya1995](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@riya1995](https://discuss.elastic.co/u/riya1995)
#### Post date: [February 16, 2020, 10:32am UTC](https://discuss.elastic.co/t/is-there-any-way-to-get-application-logged-in-user-id-in-logstash-input-statement-configuration/219513/1 "2020-02-16T10:32:42Z")

</div>

Hi All,

My application works based on user roles.The elastic search should return data based on person role.This can be achieved by getting logged in person id in the logstash input statement.Can you guys help me to sort it.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [February 16, 2020, 1:42pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-get-application-logged-in-user-id-in-logstash-input-statement-configuration/219513/2 "2020-02-16T13:42:48Z")

</div>

You cannot use a sprintf reference to an event in an input since there are no events when an input is configured. You may be able to reference an [environment variable](https://www.elastic.co/guide/en/logstash/current/environment-variables.html).

---

<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, 2020, 1:42pm UTC](https://discuss.elastic.co/t/is-there-any-way-to-get-application-logged-in-user-id-in-logstash-input-statement-configuration/219513/3 "2020-03-15T13:42:52Z")

</div>

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