Giter Club home page Giter Club logo

elf_elk_docker's Introduction

Salesforce Event Log File on ELK Stack on Docker

Overview

Salesforce Event Log File (ELF) exposes organizational usage trends and user behavior via the EventLogFile sObject. It's a fantastic feed of data that enables customers to derive insights from analytic platforms like ELK.

The ELK stack is an open-source, scalable log management stack that supports exploration, analysis, and visualization of log data.

It consists of:

  1. Elasticsearch: A Lucene-based search server for storing log data.
  2. Logstash: ETL process for retrieving, transforming, and pushing logs into data warehouses.
  3. Kibana: Web GUI for exploring, analyzing, and visualizing log data in Elasticsearch.

Because ELK is on-premise, we are using Docker as a container of settings to simplify the deployment and running of the ELK stack on commoditized hardware.

The Salesforce Event Log File Ruby Gem plug-in simplifies the integration between the ELK stack and Event Log Files by allowing you to easily download and index Salesforce event data every day without a custom integration.

To get started, all you have to do is download this repo, modify a config file, and start the service.

Prerequisites

  • Supported Operating Systems
    Linux and Mac OS X.
    Windows is not tested and not supported at the moment. However, it reportedly works when running Docker without Makefile.

  • Docker
    Install the latest version of Docker from here. You may need to restart the service after installing before you can test it with the hello-world container (e.g. sudo service docker start).

  • System Requirements
    Varies by the amount of event log file data your Salesforce organization generates. It is recommended that you have at least 4GB RAM and 16GB of free hard disk space at the minimum.

Event Log File Logstash Plugin Configuration

This section guides you in setting up Logstash Event Log File plugin configuration. The configuration is defined in the sfdc_elf.config file. Complete the following parameters in your config file:

  1. username: Your Salesforce username.
  2. password: Your Salesforce password.
  3. client_id: Salesforce connected App client ID. See 'Setting up Salesforce Connected App' section below.
  4. client_secret: Salesforce connected App client secret. See 'Setting up Salesforce Connected App' section below.
  5. security_token: Your account's security token only needed when your Force.com organization requires it.
  6. host: defaults to "login.salesforce.com", Use "test.salesforce.com" for connecting to Sandbox instance.

Instructions

Running ELF on ELK on Docker

  1. Ensure you already have Docker installed. Additionally, you need Docker Machine (not boot2docker) if you are using Max OS X.
  2. Clone or download this GIT repository.
  3. Complete the Logstash configuration (sfdc_elf.config file). See previous section for details.
  4. We provide Makefile to help you easily manage Docker images. Run your Docker container using make run. You will need to use your terminal to first navigate to the directory where this GIT repo was downloaded to (i.e. cd ~/Documents/elf_elk_docker-master) before running make run. Additional information about managing Docker containers:
    make remove removes an already running Docker container.
    make resume resumes an existing but stopped Docker container.
    See the image below for interacting with Docker container with make tool. State machine diagram for interacting with Docker containers using make tool If you are an advanced Docker user or use Windows platform, you might want to look inside scripts/ directory on how to run (scripts/run.sh), resume (scripts/resume.sh), or remove (scripts/remove.sh) Docker images.

Exploring, Analyzing, and Visualizing Data in Kibana

  1. Kibana is configured to run on port 8081. You can access it from your web browser using localhost:8081 in Linux. For Max OS X, run docker-machine ip default to determine your virtual machine's IP. Then access Kibana by going to that IP at port 8081 (e.g. http://192.168.98.100:8081).
  2. Set index pattern in Settings > Indices to logstash-* and click Create. Some mapping conflicts may occur which is fine. See screenshot below.
  3. Click Discover and start exploring and visualizing your data.

Screenshot of setting up and interacting with Kibana

Issues

Report bugs and issues here.

Contributors

(Listed in no particular order)

Appendix

Setting up a Salesforce Connected App

Detailed instructions for setting up a Connected App can be found here. When configuring the connected application, ensure the following options are configured:

  1. Enable OAuth Settings is checked.
  2. Access and manage data (api) and Access your basic information (id, profile, email, address, phone) are included in your Selected OAuth Scopes.

Blogs, Articles, and Tutorials

  1. Elf on Elk on Docker by Adam Torman
  2. 'Users: WE KNOW THEM' โ€“ The ELF@Salesforce at Elastic{ON} '16 by Adam Torman and Abhishek Sreenivasa

elf_elk_docker's People

Contributors

abisek avatar svc-scm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elf_elk_docker's Issues

Docker : Error respinse from daemon: pull access denied on elf_on_elk, repository does not exist or may require 'docker login'

ubuntu@ip-172-31-0-164:~/Documents/elf_elk_docker-master$ make run
Sending build context to Docker daemon 23.04kB
Step 1/12 : FROM java:8
8: Pulling from library/java
5040bd298390: Pull complete
fce5728aad85: Pull complete
76610ec20bf5: Pull complete
60170fec2151: Pull complete
e98f73de8f0d: Pull complete
11f7af24ed9c: Pull complete
49e2d6393f32: Pull complete
bb9cdec9c7f3: Pull complete
Digest: sha256:c1ff613e8ba25833d2e1940da0940c3824f03f802c449f3d1815a66b7f8c0e9d
Status: Downloaded newer image for java:8
---> d23bdf5b1b1b
Step 2/12 : MAINTAINER [email protected]
---> Running in b65b75ab4e40
Removing intermediate container b65b75ab4e40
---> f28a2082c94e
Step 3/12 : RUN apt-get update
---> Running in 2dfdd44da951
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [16.3 kB]
Ign http://deb.debian.org jessie-backports InRelease
Get:3 http://deb.debian.org jessie Release.gpg [1652 B]
Ign http://deb.debian.org jessie-backports Release.gpg
Get:4 http://deb.debian.org jessie Release [77.3 kB]
Ign http://deb.debian.org jessie-backports Release
Err http://deb.debian.org jessie-backports/main amd64 Packages

Err http://deb.debian.org jessie-backports/main amd64 Packages

Err http://deb.debian.org jessie-backports/main amd64 Packages

Err http://deb.debian.org jessie-backports/main amd64 Packages

Get:5 http://security.debian.org jessie/updates/main amd64 Packages [977 kB]
Err http://deb.debian.org jessie-backports/main amd64 Packages
404 Not Found
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [20 B]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.2 MB in 4s (2163 kB/s)
W: There is no public key available for the following key IDs:
AA8E81B4331F7F50
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
Unable to find image 'elf_on_elk:0.1' locally
docker: Error response from daemon: pull access denied for elf_on_elk, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

Could please help me here

Thanks In advance

Do we need to account on docker to run ELK

Facing below error while running "make run" command

Get:7 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.2 MB in 6s (1649 kB/s)
W: There is no public key available for the following key IDs:
AA8E81B4331F7F50
W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
Unable to find image 'elf_on_elk:0.1' locally
docker: Error response from daemon: pull access denied for elf_on_elk, repository does not exist or may require 'docker login'.
See 'docker run --help'.

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.