Splunk Search

splunk search for users logging onto servers

chetanchauhan
New Member

Hi,

I have deployed splunk to log data of users who are logging onto servers (unix and windows). I want to create a report that shows users who are not permitted to log onto those servers. I have been given a list of users which are permitted to log on so wanted to create a search which shows user logging on except the permitted users. I am trying to use the following:

  • | stats count by User

Please can someone advise what commands to use to included the list of permitted users i have and to exempt them from the search result?

Regards,

Chetan

Tags (2)
0 Karma

chetanchauhan
New Member

Hi,

thanks the following worked:

EventCode=18453 | search NOT [ | inputlookup allowed_users.csv ] | stats count by User

however the header of the CSV file should be User to match the syslog message.

Regards,

0 Karma

somesoni2
Revered Legend

Yuou can rename the field name in subsearch. That way you can keep your csv headers same as before.

0 Karma

chetanchauhan
New Member

,Hi,

thanks for your assistance. is there any particular place the allowed_user.csv would need to be? for example if i am on a Terminal Server and running Splunk HTTP can that csv be somewhere on that terminal server and i direct the lookup to it?

Regards,

0 Karma

kalianov
Path Finder

I think that your user.csv must be placed in $SPLUNK_HOME/ etc/system/lookups
on your splunk server and you need to add some stanzas to the $SPLUNK_HOME/ etc/system/transforms.conf
somthing like that:
[allowed_users]
filename=user.csv

0 Karma

somesoni2
Revered Legend

Try something like this (assuming you have the list of permitted users and configured it as lookup, say allowed_users.csv)

your base search giving all users | search NOT [ |inputlookup allowed_users.csv | table User] | stats count as LoginCount by User

This should show you Login count for the users which are not present in the allowed_users.csv which users which are allowed.

Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...