Splunk Dev

Find user does not working on Python code

Jooyoung
Path Finder

Following code is to find specific user("eveadams"). But it does not work.

# Find User
kwargs = {"name": "eveadams"}

try:
    users = service.users.list(**kwargs)
    for user in users:
        print "%s - %s" % (user.realname, user.name)

except: # new user
    print "Cannot find the user"

eveadams is already exist in splunk. But the result is always "Cannot find...".

Tags (1)
0 Karma

p_gurav
Champion

Can you try this:

kwargs = {"name": "eveadams"}
users = service.users.list(**kwargs)
 try:
     for user in users:
         print "%s - %s" % (user.realname, user.name)
 except: # new user
     print "Cannot find the user"
0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...