Code Monkey home page Code Monkey logo

salesforce-event-logs-downloader's Introduction

salesforce-event-logs-downloader

Python scripts for automated downloading of Salesforce Event Log Files (ELF) using customizable filters. Streamline log retrieval for audits, compliance, or monitoring with minimal setup.

Project setup

.env file setup

  • Use the below sample & set the values accordingly.
# .env

# salesforce auth params
SF_CONSUMER_KEY=placeholder
SF_CONSUMER_SECRET=placeholder
SF_USERNAME=placeholder
SF_PASSWORD=placeholder
SF_AUTH_URL=https://yourdomain.sandbox.my.salesforce.com/services/oauth2/token
SF_TOKEN_LIFETIME=3600
SF_VERSION_NUMBER=59.0

# salesforce query params
SF_DOMAIN_NAME=yourdomain.sandbox.my.salesforce.com
EVENT_QUERY_PAIRS={"ApexExecution":"scripts/soql/event_logs/apex_execution.soql","ApexTrigger":"scripts/soql/event_logs/apex_trigger.soql","FlowExecution":"scripts/soql/event_logs/flows.soql","ApexUnexpectedException":"scripts/soql/event_logs/apex_exceptions.soql","LightningPageView":"scripts/soql/event_logs/ltg_page_view.soql"}

# directory params
OUTPUT_DIRECTORY=placeholder
CURRENT_SPRINT_DIRECTORY=placeholder
EVENT_LOG_BASE_DIR=placeholder
EVENT_TYPES_MAPPING={"ApexExecution":"APEX_EXECUTION","ApexTrigger":"APEX_TRIGGER","FlowExecution":"FLOW_EXECUTION","ApexUnexpectedException":"APEX_UNEXPECTED_EXCEPTION","LightningPageView":"LIGHTNING_PAGE_VIEW","API":"API"}

Create directories locally to store downloaded files

  • To keep things uniform and organized, the directory setup uses parameters like Financial Year, Quarter & Sprint name.
  • Pass the Financial Year, Quarter & Sprint name as parameters
python3 ./scripts/python/cURL/create_dir.py FY2024 Q3 SPRINT_T                                                                                                                                                                                                                                            

Download Event Logs

  • Run the below command to download event logs.
python3 ./scripts/python/cURL/download_logs.py

salesforce-event-logs-downloader's People

Contributors

mg-rx93 avatar

Watchers

 avatar

salesforce-event-logs-downloader's Issues

Debug code

Run debugger and test the created debug configs.

Ensure you are connected to a sandbox org and it has the related event logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.