Until very recently, Setup Audit Trail was only available to manually download to a CSV (comma separated values) file using a link on a page in setup. I kept hearing how customers hated putting manual processes in place to click the link once a month as well as merge newly downloaded CSV files into previous exports. It made audit and compliance use cases much harder than what anyone wanted. Everyone was asking to integrate the Setup Audit Trail using the API so they could schedule regular, automated downloads of audit trail data to analytics and SIEM tools.
Starting with Winter '16, we added the Setup Audit Trail to the API as the SetupAuditTrail sObject. There are a couple key use cases that you might want to try out using a tool like Workbench.
1. I want to know everyone who logged in as a particular end-user:
SELECT Action, CreatedById, CreatedDate, DelegateUser, Display, Id, Section
FROM SetupAuditTrail
WHERE CreatedBy.Name = 'Jim Rivera'
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
SELECT Action, CreatedById, CreatedDate, DelegateUser, Display, Id, Section
FROM SetupAuditTrail
WHERE CreatedBy.Name = 'Jim Rivera'
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
2. I want to know everyone an admin user logged in as:
SELECT Action, CreatedBy.Name, CreatedDate, DelegateUser, Display, Id, Section
FROM SetupAuditTrail
WHERE DelegateUser = 'at@xx.com'
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
FROM SetupAuditTrail
WHERE DelegateUser = 'at@xx.com'
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
3. I want to know everything that any users with a specific profile (or role) did in setup:
SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section
FROM SetupAuditTrail
WHERE CreatedBy.Profile.Name = 'EMEA VP'
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
FROM SetupAuditTrail
WHERE CreatedBy.Profile.Name = 'EMEA VP'
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
4. I want to know every user who was 'frozen' in the last week
SELECT Action, CreatedById, CreatedDate, DelegateUser, Display, Id, Section
FROM SetupAuditTrail
WHERE Action = 'frozeuser' AND CreatedDate = Last_n_Days:7
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
FROM SetupAuditTrail
WHERE Action = 'frozeuser' AND CreatedDate = Last_n_Days:7
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
5. I want to know everything a specific user did last week
SELECT Action, CreatedById, CreatedDate, DelegateUser, Display, Id, Section
FROM SetupAuditTrail
WHERE CreatedBy.Name = 'Adrian Kunzle' AND CreatedDate = Last_n_Days:7
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
FROM SetupAuditTrail
WHERE CreatedBy.Name = 'Adrian Kunzle' AND CreatedDate = Last_n_Days:7
ORDER BY CreatedDate DESC NULLS FIRST LIMIT 10
I use 'Limit 10' to just test the queries and keep them from taking a long time to return which is a good idea when experimenting with new queries.
Once you know what kind of queries you can write, you can create incredible apps that combine the SetupAuditTrail API with an app building platform like Node.js on Heroku:
Once you know what kind of queries you can write, you can create incredible apps that combine the SetupAuditTrail API with an app building platform like Node.js on Heroku:
The application above was created by the incredible Alessandro. You can download the source code from his Github repository or try it out with this free Heroku app.
You can also explore Setup Audit Trail data using an analytics platform like Wave:
The Setup Audit Trail is a powerful way of tracking important administrative audit events and now it's even more accessible through the API.
Two words, thank you.
ReplyDeleteThank you for reading the blog and using the feature!!
DeleteExcellent post.
ReplyDeleteThank you for reading the blog and using the feature!!
DeleteThis comment has been removed by the author.
ReplyDeleteJust did find this post, excellent.
ReplyDeleteOne question about data not visible.
I can find SetupAuditTrail sObject the Display like "Logged out using Login-As access for " but not a Display like "Logged in using Login-As access for ".
In "View Setup Audit Trail" both are present. Any idea why "Logged in using Login-As" is not visible?
Sounds like it could be a bug. Could you please file a case with support and let them know what you’re seeing so we can get it fixed. Thanks!
DeleteWhile IT ventures like internet business, online life, correspondence, Robotics, Artificial Intelligence and so on require Data Scientists as mass level, other fat-off enterprises like restorative sciences, biotechnology, amusement organizations, flight and coordinations and so on.ExcelR Data Science Courses
ReplyDeleteThe app looks great, is it still useful in 2019? ;
ReplyDeletePositive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. audit
ReplyDeleteSuch a very useful article. Very interesting to read this article. I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteData Science Course in Pune
Data Science Training in Pune
I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
ReplyDeleteData Science Institute in Bangalore
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
ReplyDeleteData Science Certification in Bangalore
It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing.
ReplyDeleteData Science Course in Bangalore
I really thank you for the valuable info on this great subject and look forward to more great posts
ReplyDeleteData Science Training in Bangalore
Efficiently written information. It will be profitable to anybody who utilizes it, counting me. Keep up the good work. For certain I will review out more posts day in and day out. Hire a professional phone hacker
ReplyDeleteThis is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.iot training in delhi
ReplyDeleteI at last discovered extraordinary post here.I will get back here. I just added your blog to my bookmark locales. thanks.Quality presents is the vital on welcome the guests to visit the page, that is the thing that this website page is giving.
ReplyDelete360DigiTMG
Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.
ReplyDelete360DigiTMG Business Analytics Course
Terrific post thoroughly enjoyed reading the blog and more over found to be the tremendous one. In fact, educating the participants with it's amazing content. Hope you share the similar content consecutively.
ReplyDelete360DigiTMG Data Analytics Course
I always like to the latest technological information but if you are worried due to the coronavirus disease and feeling a lot of difficult to make in-depth research for you dissertation , you can select to Dissertation Writing Service
ReplyDeletePositive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. site de rencontre sérieux
ReplyDeletethe info you have provided in this blog is very nice, appreciable.
ReplyDeleteif you required any info regarding, Income tax returns and GST Filings, please visit
Great idea man thanks keep it up all the time. I am very happy to see your standard. we also provide SIEM Service Providers. for more information visit on our website.
ReplyDeletethe information you have updated is very good and useful, please update further.
ReplyDeleteif you require any info regarding TAX & GSTR please visit
Tax consultants in Bangalore|
GST consultants in Bangalore|
Company registration in Bangalore|
Company name registration in Bangalore|
how to register a startup company in Bangalore
company registration cost Bangalore|
company registration online Bangalore|
pvt ltd company registration fees Bangalore|
pvt ltd registration Bangalore|
new company registration Bangalore
ExcelR provides Data Science course. It is a great platform for those who want to learn and become a Data Science Courses. Students are tutored by professionals who have a degree in a particular topic. It is a great opportunity to learn and grow.
ReplyDeleteData Science courses
data science course in pune
data scientist course in pune with placement
data scientist course in pune