-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x-pack/filebeat/input/salesforce: Bug fixes and improvements #41015
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
if resp.StatusCode != http.StatusOK { | ||
resp.Body.Close() | ||
return err | ||
return fmt.Errorf("unexpected status code %d for log file", resp.StatusCode) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most important change. only resp with 200 status code should be allowed to go forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provided few minor comments. Otherwise LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just left a small suggestion, rest looks good to me.
(cherry picked from commit 9ae6ed1)
…#41067) (cherry picked from commit 9ae6ed1) Co-authored-by: subham sarkar <[email protected]>
Proposed commit message
Add more debug logs and for requesting log files do check for 200 status code and then only allow. More details here.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Connect with SF instance and collect documents. Samples docs here:
apex
{ "@timestamp": "2024-10-01T11:40:55.686Z", "@metadata": { "beat": "filebeat", "type": "_doc", "version": "9.0.0", "pipeline": "filebeat-9.0.0-salesforce-apex-pipeline" }, "ecs": { "version": "8.0.0" }, "event": { "timezone": "+05:30", "provider": "EventLogFile", "dataset": "salesforce.apex", "module": "salesforce" }, "service": { "type": "salesforce" }, "input": { "type": "salesforce" }, "salesforce": { "instance_url": "" }, "message": "{\"CALLOUT_TIME\":\"0\",\"CLIENT_IP\":\"\",\"CPU_TIME\":\"58\",\"DB_TOTAL_TIME\":\"26\",\"ENTRY_POINT\":\"DNBConnect.DNB_LinkageOpportunity_Batch\",\"EVENT_TYPE\":\"ApexExecution\",\"EXEC_TIME\":\"90\",\"IS_LONG_RUNNING_REQUEST\":\"0\",\"LOGIN_KEY\":\"\",\"NUMBER_SOQL_QUERIES\":\"1\",\"ORGANIZATION_ID\":\"\",\"QUIDDITY\":\"BA\",\"REQUEST_ID\":\"-\",\"RUN_TIME\":\"127\",\"SESSION_KEY\":\"\",\"TIMESTAMP\":\"20240924140008.050\",\"TIMESTAMP_DERIVED\":\"2024-09-24T14:00:08.050Z\",\"URI\":\"\",\"URI_ID_DERIVED\":\"\",\"USER_ID\":\"\",\"USER_ID_DERIVED\":\"IAK\"}", "tags": [ "salesforce-apex", "forwarded" ], "fileset": { "name": "apex" }, "agent": { "version": "9.0.0", "ephemeral_id": "", "id": "", "name": "", "type": "filebeat" } }login
{ "@timestamp": "2024-10-01T11:41:01.222Z", "@metadata": { "beat": "filebeat", "type": "_doc", "version": "9.0.0", "pipeline": "filebeat-9.0.0-salesforce-login-default" }, "event": { "dataset": "salesforce.login", "module": "salesforce", "timezone": "+05:30", "provider": "EventLogFile" }, "tags": [ "salesforce-login", "forwarded" ], "fileset": { "name": "login" }, "service": { "type": "salesforce" }, "salesforce": { "instance_url": "" }, "agent": { "ephemeral_id": "", "id": "", "name": "", "type": "filebeat", "version": "9.0.0" }, "message": "{\"API_TYPE\":\"\",\"API_VERSION\":\"9998.0\",\"AUTHENTICATION_METHOD_REFERENCE\":\"\",\"AUTHENTICATION_SERVICE_ID\":\"\",\"BROWSER_TYPE\":\"\",\"CIPHER_SUITE\":\"TLS_AES_256_GCM_SHA384\",\"CLIENT_IP\":\"\",\"CPU_TIME\":\"62\",\"DB_TOTAL_TIME\":\"85692869\",\"EVENT_TYPE\":\"Login\",\"FORWARDED_FOR_IP\":\"\",\"LOGIN_KEY\":\"Am2nijOL2d98wLS3\",\"LOGIN_STATUS\":\"LOGIN_NO_ERROR\",\"LOGIN_SUB_TYPE\":\"oauthpassword\",\"LOGIN_TYPE\":\"A\",\"ORGANIZATION_ID\":\"\",\"REQUEST_ID\":\"SLB:\",\"REQUEST_STATUS\":\"S\",\"RUN_TIME\":\"182\",\"SESSION_KEY\":\"\",\"SOURCE_IP\":\"\",\"TIMESTAMP\":\"20240930031304.166\",\"TIMESTAMP_DERIVED\":\"2024-09-30T03:13:04.166Z\",\"TLS_PROTOCOL\":\"TLSv1.3\",\"URI\":\"/services/oauth2/token\",\"URI_ID_DERIVED\":\"\",\"USER_ID\":\"\",\"USER_ID_DERIVED\":\"IAK\",\"USER_NAME\":\"\",\"USER_TYPE\":\"Standard\"}", "input": { "type": "salesforce" }, "ecs": { "version": "8.0.0" } }