Security

Find the current logged in user via python script

ppurokit
Path Finder

Hi All,

I have the following requirement:

I have three users with the same permissions. Each user has been provided permission only to access his own created Index.

For Example:

User 1 --> Index 1

User 2 --> Index 2

User 3 --> Index 3

I have a dashboard created which has some search queries which is common for all the logged in users.

When user1 schedules a dashboard report , the "sendemail.py" script gets triggered generating the PDF.

I need to append the user name on which user has scheduled to run the report, to the file name of the pdf which gets generated.

I know that authorize.conf is a file which stores all the user's details on providing which user has access to which indexes and other details.

I need the user who has scheduled the report so that , if i know the user name i can access authorize.conf file and get other details also about that user.

Please help me on how i can achieve the same.

0 Karma

somesoni2
Revered Legend

Following answer has the custom python script to get the current user name. Hope this helps.

0 Karma
Get Updates on the Splunk Community!

Splunk App for Anomaly Detection End of Life Announcement

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...