Splunk Search

Help with join query for Salesforce

linaaabad
Observer

Hello Smarties...

Can someone offer some assistance; We recently started ingesting Salesforce into Splunk, Username are coming in as ID's (00000149345543qba), instead of Jane Doe. So was told to use the Join to get the Usernames or Names, and add to the sourcetype I need "joined" with;  So I am trying to get the "Login As"  events which is under the sourcetype="sfdc:setupaudittrail" - how do I get the Login As events with usernames, if usernames are under the user index and the login as events are under the setupaudittrail sourcetype? Here is my attempted search which doesn't come up with anything; But I know the events exist...

 

index=salesforce sourcetype="sfdc:user" 
| join type=outer UserAccountId [search index=salesforce sourcetype="sfdc:setupaudittrail" Action=suOrgAdminLogin]

Labels (1)
0 Karma

MuS
SplunkTrust
SplunkTrust

Hi there,

without sample events this can be tricky but since you provided the SPL and you join on UserAccountId I assume this field is available in both sourcetypes.

If this is case, it would be as simple as

 

index=salesforce UserAccountId=* sourcetype="sfdc:user" OR ( sourcetype="sfdc:setupaudittrail" Action=suOrgAdminLogin )
| fields list of fields you want
| stats values(*) AS * by _time UserAccountId

 

Hope this helps ...

cheers, MuS

 

sainag_splunk
Splunk Employee
Splunk Employee

Hello @linaaabad!

@MuS solution should give you a good start. Please don't use "join" instead use stats .. by as  above.

Refer the below for documentation.
https://lantern.splunk.com/Splunk_Platform/Product_Tips/Searching_and_Reporting/Writing_better_queri...

https://conf.splunk.com/watch/conf-online.html?search=PLA1528B#/

 

 

If this helps, Upvote!!!!
Together we make the Splunk Community stronger 
0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...