Giter VIP home page Giter VIP logo

srl-elk-lab's Introduction

Intro

This repo contains containerlab-based labs demonstrating how logs from SR Linux network elements can be collected, parsed, and stored using Elasticsearch/Logstash/Kibana (ELK) stack.

A series of blog posts go into the details of various ELK deployment models:

  1. SR Linux logging with ELK - an introduction to the modern logging infrastructure using ELK stack.

Lab Topology

The srl-elk.clab.yml topology represents a 2-tier Clos fabric with 2 clients participating in a single L2 EVPN domain.

ELK lab topology

Naming conventions are straighforward:

  • leaf[1-3] - leaves
  • spine[1,2] - spines
  • client[1,2] - emulated clients

client1 connectivity uses a single interface attached to leaf1. client2 is connected as A/S to leaf2 and leaf3 with standby link signalling using LACP.

spine1 and spine2 are acting as BGP RR. This setup is sufficient to demonstrate a way to integrate a fabric with ELK stack.

Quick start

In order to bring up your lab follow the next simple steps:

  1. Clone repo
git clone https://github.com/azyablov/srl-elk-lab.git
cd srl-elk-lab
  1. Deploy the lab
cd <lab folder>
sudo clab deploy -t srl-elk.clab.yml
  1. For the fast and convenient start of demo, dashboard and discover search configuration objects are provided as part of the lab.

Run add-saved-objects.sh in order to avoid manual import and creation.

./add-saved-objects.sh

Demo dashboard can be adjusted as necessary.

  1. Run simulation to quickly ingest data into elasticsearch as described in Simulation

Note! Index template is created automatically by logstash (to avoid automatic template creation by elastic). manage_template and template* configuration option stanzas are defining such logstash behavior.

output {
    if "srlinux" in [tags] {
        if "_grokparsefailure" in [tags] {
            file {
                path => "/srl/fail_to_parse_srl.log"
                codec => rubydebug
            }
        } else {
            elasticsearch {
                hosts => ["http://elastic"]
                ssl => false
                index => "fabric-logs-%{+YYYY.MM.dd}"
                manage_template => true
                template => "/tmp/index-template.json"
                template_name => "fabric-template"
                template_overwrite => true
                id => "fabric-logs"
            }
        }
    }
}

Simulation

In order to help quickly enrich ELK stack with logs outage_simulation.sh script could be executed with the following parameters:

-S - to replace configuration for logstash remote server under /system/logging/remote-server[host=$LOGSTASHIP]" with new one.

<WAITTIMER> - to adjust time interval between destructive actions applied (20 sec by default).

Basic configuration can found here, which represent default lab configuration, and can be adjusted per your needs and requirements.

./outage_simulation.sh -S

By default configuration for remote server using UDP:

    {
      "host": "172.22.22.11",
      "remote-port": 1514,
      "subsystem": [
        {
          "priority": {
            "match-above": "informational"
          },
          "subsystem-name": "aaa"
        },
        {
          "priority": {
            "match-above": "informational"
          },
          "subsystem-name": "acl"
        },
<...output omitted for brevity...>
    }

Note! In case TLS is a requirement, you can consider to put rsyslog in front, simple docker image with self-signed and custom certificate can be found on github.com/azyablov/rsyslogbase

To run simulation just execute ./outage_simulation.sh or ./outage_simulation.sh 15 in case machine is a bit slow or you have another labs running on the same compute.

Outage Simulation

Kibana

Your pre-configured Kibana should available via http://localhost:5601. Now you can go to to Discovery and Dashboard under Analytics and see a demo dashboard.

kibana discovery

kibana dashboard

srl-elk-lab's People

Contributors

azyablov avatar hellt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hellt

srl-elk-lab's Issues

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.