Refine your search:

Is there a search for finding Splunk instance users who have not logged in for X amount of time eg. not logged in for the last 6 months? audit.log contains information on users last login attempt that succeeded. Would a look up setup be the approach?

asked 22 Feb '10, 23:21

Ellen's gravatar image

Ellen ♦
1.8k319
accept rate: 72%

edited 23 Feb '10, 03:21

V_at_Splunk's gravatar image

V_at_Splunk
8121414


2 Answers:

Obviously it's easy to find who has logged in within some past period of time. To find the complement of this, you have to know the full set, i.e., you need a list of all possible users who might have logged in. You can get this either from some canonical external source, or you could generate it by running over an even longer period:

 | inputlookup allusers | search NOT [ index=_audit action="login attempt" info="succeeded" earliest=-6mon | dedup user | fields user ]

or

 index=_audit action="login attempt" info="succeeded" earliest=-18mon latest=-6mon NOT [ index=_audit action="login attempt" info="succeeded" earliest=-6mon | dedup user | fields user ]

You could also generate the lookup on an ongoing basis with a scheduled search:

 index=_audit action="login attempt" info="succeeded" | dedup user | fields user | inputlookup append=t allusers | dedup user | outputlookup allusers

You would run this once over the long past to generate the initial table, then run it every (say) 24 hours over the past 24 hours to keep it up-to-date.

link

answered 23 Feb '10, 04:30

gkanapathy's gravatar image

gkanapathy ♦
26.4k1622
accept rate: 42%

-1

You've pretty much answered your own question. Search for source=audit.log endmonthsago=6, and then | DEDUP user.

Splunk makes it easy!    8)

link

answered 23 Feb '10, 02:23

V_at_Splunk's gravatar image

V_at_Splunk
8121414
accept rate: 42%

Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×66
×59
×38

Asked: 22 Feb '10, 23:21

Seen: 1,090 times

Last updated: 09 Mar '10, 05:28

Copyright © 2005-2012 Splunk, Inc. All rights reserved.