Coder Social home page Coder Social logo

emlogdownloader's Introduction

EMLogDownloader

EMLogDownloader is a cli tool to download Event Monitoring log files.

Dependency

  • Java 1.8+
  • Connected App with api oauth scope must be created on Salesforce.

Edit config file

In order to use this tool, you need to update the config file(EMLogDownLoader.yaml) according to your environment.

EMLogDownload-Setting:
    DownloadPath: "./download"
    LoginHost: "https://login.salesforce.com"
    ApiVersion: "59.0"
    EventType: ""
    # If the following values are not set, It sets it interactively at execution.
    ClientId: ""
    ClientSecret: ""
    UserName: ""
    Password: ""
  • DownloadPath specifies the directory where the CSV files of event logs will be downloaded.
  • EventType specifies the target EventTypes for download, separated by commas (e.g., "Login,Logout"). If EventType is undefined, it includes all EventTypes.
  • ClientId and ClientSecret should be set to the values obtained from the created Connected App.
  • UserName and Password specify the login information for the user.

Usage

java -jar EMLogDownloader-1.0.0.jar -help
usage: EMLogDownloader [-options]
    -config <pathname>         Specifies config file path. (Default is ./EMLogDownloader.yaml)
    -date <targetdate>         Specifies download EMLog date. (Format is "yyyy-MM-dd")
    -hourlylog                 Get hourly event log files.
    -hour <targethour>         Specifies download EMLog hour. (Format is "hh")

To execute EMLogDownloader run the following command. EMLogDownLoader.yaml must be located in the current directory.

java -jar EMLogDownloader-1.0.0.jar

To specify the path of the config file, use the option of -config.

java -jar EMLogDownloader-1.0.0.jar -config confiig/EMLogDownLoader.yaml

To specify the date of download, use the option of -date. If not specified, enter it interactively.

java -jar EMLogDownloader-1.0.0.jar -date 2019-02-01

If you download hourly log, use the option of -hourlylog.

java -jar EMLogDownloader-1.0.0.jar -hourlylog

To specify the date and hour of download in hourly log mode, use the option of -date and -hour. If not specified, enter it interactively.

java -jar EMLogDownloader-1.0.0.jar -hourlylog -date 2019-02-01 -hour 01

Execution sample

$ java -jar EMLogDownloader-1.0.0.jar -config EMLogDownLoader.yaml -date 2023-11-30
[EventMonitoring Log Downloader:Start]

  [Parameter]
    downloadPath: ./download
    loginHost: https://login.salesforce.com
    userName: (UserName)
    apiVersion: 59.0
    targetDate: 2023-11-30
    eventType: (ALL)
    accessToken: (AccessToken)

  [Download progress]
    (1/7) EventType:ApiTotalUsage Length:665 DownloadFile:EventLog_ApiTotalUsage_2023-11-30.csv
    (2/7) EventType:Login Length:835 DownloadFile:EventLog_Login_2023-11-30.csv
    (3/7) EventType:Logout Length:506 DownloadFile:EventLog_Logout_2023-11-30.csv
    (4/7) EventType:RestApi Length:1078 DownloadFile:EventLog_RestApi_2023-11-30.csv
    (5/7) EventType:Sites Length:761 DownloadFile:EventLog_Sites_2023-11-30.csv
    (6/7) EventType:PlatformEncryption Length:1310 DownloadFile:EventLog_PlatformEncryption_2023-11-30.csv
    (7/7) EventType:URI Length:813 DownloadFile:EventLog_URI_2023-11-30.csv

[EventMonitoring Log Downloader:Finish]

Build

To build and run this application locally, you'll need latest versions of Git, Maven and JDK installed on your computer. From your command line:

# Clone this repository
$ git clone [email protected]:masaaki-taguchi/EMLogDownloader.git

# Go into the repository
$ cd EMLogDownloader

# Build
$ mvn

# Run the app
$ java -jar target/EMLogDownloader-1.0.0.jar

License

EMLogDownloader is licensed under the MIT license.

emlogdownloader's People

Contributors

masaaki-taguchi avatar

Watchers

 avatar

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.