Almost Wrong Way To Send Docker Containers logs To ELK

In this article, we’ll walk through setting up a Docker-based ELK (Elasticsearch, Logstash, and Kibana) stack to collect, view, and send Docker logs. services: elasticsearch: image: elasticsearch:7.17.24 environment: - discovery.type=single-node volumes: - ./elasticsearch_data/:/usr/share/elasticsearch/data mem_limit: "1g" redis-cache: image: redis:7.4.0 logstash-agent: image: logstash:7.17.24 volumes: - ./logstash-agent:/etc/logstash command: logstash -f /etc/logstash/logstash.conf depends_on: - elasticsearch ports: - 12201:12201/udp logstash-central: image: logstash:7.17.24 volumes: - ./logstash-central:/etc/logstash command: logstash -f /etc/logstash/logstash.conf depends_on: - elasticsearch kibana: image: kibana:7.17.24 ports: - 5601:5601 environment: - ELASTICSEARCH_HOSTS=http://elasticsearch:9200 depends_on: - elasticsearch ElasticSearch Just create a folder named elasticsearch_data for storing data....

October 16, 2024 · 3 min · Alex Popescu

Linux Login Update Notifier Script With Python

Introduction Do you ever want to get a notification with the number of updates required when logging into XFCE in debian/ubuntu like systems ? There is a simple python script that can do just that. It uses notify-send command and paired with the magic command that returns the update count, we get the next python script: #!/usr/bin/env python3 import os import subprocess # Run the apt-get command and grep the output command = 'apt-get --simulate upgrade | grep "upgraded....

August 29, 2024 · 2 min · Alex Popescu

Automated Fake Database Population with Python

Introduction In this article, we’ll explore a Python script that leverages mimesis library to populate an (Azure) SQL database with fake data. The Code import logging import random import pandas as pd import pymssql import sqlalchemy from dotenv import dotenv_values from mimesis import Address, Datetime, Person from mimesis.enums import Gender from sqlalchemy import create_engine # Load environment variables config = dotenv_values(".env") # Configure logging to both console and file logFormatter = logging....

March 17, 2024 · 3 min · Alex Popescu