Pull data from the ServiceNow API
Overview
Get a list of Salesforce query events through the Salesforce API using the HTTP Pull Listener.
HTTP Pull Listener configuration
In Falcon Onum, go to the Listeners area and click New Listener > HTTP Pull. Give a name to your new Listener and enter the following data:
Parameters
Add the following parameter:
Name -
instanceUrlValue - Enter your Salesforce instance URL.
Name -
apiVersionValue - Enter your Salesforce API version.
Secrets
You must define these credentials in Onum:
clientIdwill reference your Salesforce client ID.clientSecretwill reference your Salesforce client secret.usernamewill reference your Salesforce username.passwordwill reference your Salesforce password.
To do it, click Add element and enter a Name for the secret (in this case, clientId). Then, click the Value field and select New secret to create a new one:
Give the secret a Name.
Turn off the Expiration date option.
Click Add new value and paste the secret corresponding to the value.
Click Save.
You can now select the secret you just created in the Value field list. Repeat the process for the rest of secrets.
Learn more about secrets in Onum in this article.
Setup
After entering the required parameters and secrets, you can choose to manually enter the rest of configuration fields, or simply paste the given YAML:
Toggle ON the Config as YAML option to enable a free text field where you can paste the following YAML:
Temporal Window
Toggle ON to add a temporal window for events. This repeatedly shifts the time window over which data is collected.
Duration -
5mOffset -
5mFormat -
RFC3339
Authentication
Toggle ON to configure the authentication phase.
Type -
tokenToken Retrieve Based Authentication
Request
Method -
POSTURL -
${parameters.instanceUrl}/services/oauth2/tokenHeaders
Name -
Content-TypeValue -
application/x-www-form-urlencoded
Body Type -
urlEncodedBody Params
Name -
grant_typeValue -
passwordName -
client_idValue -
${secrets.clientId}Name -
client_secretValue -
${secrets.clientSecret}Name -
usernameValue -
${secrets.username}Name -
passwordValue -
${secrets.password}
Token path -
.access_tokenAuth injection
In -
headerName -
AuthorizationPrefix -
'Bearer '
Enumeration Phase
Toggle ON and configure the following:
Pagination Type -
CursorCursor Selector -
.nextRecordsUrlInitial Request
Response Type -
JSONMethod -
GETURL -
${parameters.instanceUrl}/services/data/${parameters.apiVersion}/queryHeaders
Name -
AcceptValue -
application/jsonName -
Content-TypeValue -
application/json
Query Params
Name -
qValue -
SELECT Id, EventType, LogDate, CreatedDate FROM EventLogFile WHERE LogDate >= ${temporalWindow.from} AND LogDate < ${temporalWindow.to} ORDER BY LogDate
Next Request
Response Type -
JSONMethod -
GETURL -
${parameters.instanceUrl}/services/data/${parameters.apiVersion}/query/${pagination.cursor}Headers
Name -
AcceptValue -
application/jsonName -
Content-TypeValue -
application/json
Output
Select -
.recordsFilter -
.Map -
.Output Mode -
element
Collection Phase
Inputs
Name -
eventLogFileIdExpression -
.IdName -
eventTypeExpression -
.EventTypeName -
logDateExpression -
.LogDate
Pagination Type -
NoneRequest
Response Type -
JSONMethod -
GETURL -
${parameters.instanceUrl}/services/data/${parameters.apiVersion}/sobjects/EventLogFile/${inputs.eventLogFileId}/LogFile
Headers
Name -
AcceptValue -
text/csvName -
Accept-EncodingValue -
gzip
Output
Select -
.Map -
{"SFDCLogId": ${inputs.eventLogFileId}, "SFDCLogType": ${inputs.eventType}, "SFDCLogDate": ${inputs.logDate}, "content": .}Output Mode -
element
When you're done, click Create labels to move on to the next step and define the required Labels if needed.
Last updated
Was this helpful?

