All Apps and Add-ons

Writing a Splunk Query - Unique Count of Initial Access Key Usage from Cloudtrail

tosilesi19
New Member

I have a use case to write a splunk query to display in a line or area chart the unique and initial AWS access key usage by IAM users in our org trending for the past year. Management want to be able to visually show increased cloud adoption numbers over time. Any ideas on how to display this? I feel like I'm almost there with stats but not quite.

index=blah sourcetype=blah user_type=SAMLuser | stats earliest(eventTime) by userIdentity.userName

This almost gets me there, but it won't depict the stats in a pretty line chart.

Thanks!

0 Karma

to4kawa
Ultra Champion

If eventTime is epoch time, how about this?

index=blah sourcetype=blah user_type=SAMLuser 
| stats earliest(eventTime) as _time by userIdentity.userName
| timechart count by userIdentity.userName
0 Karma

tosilesi19
New Member

this gets me closer! but the userIdentity.userName values are all just flat on the x-axis. I need them to display clearly based on the date they were first used.

0 Karma

to4kawa
Ultra Champion

what's y-axis?
a line or area chart's y-axis is number,you know.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...