Skip to content

Instantly share code, notes, and snippets.

View ggnanasekaran77's full-sized avatar

Gnanasekaran Gajendiran ggnanasekaran77

View GitHub Profile
@ggnanasekaran77
ggnanasekaran77 / esk-docker-compose.yaml
Last active September 25, 2021 00:11
esk-docker-compose.yaml
version: '2.2'
services:
es01:
image: elasticsearch:7.14.1
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es02,es03
- cluster.initial_master_nodes=es01,es02,es03
@ggnanasekaran77
ggnanasekaran77 / esk-geoip-pipeline.json
Last active September 25, 2021 00:11
esk-geoip-pipeline.json
PUT _ingest/pipeline/geoip
{
"description" : "Add geoip info",
"processors" : [
{
"geoip" : {
"field" : "RemoteIP"
}
}
]
PUT _index_template/csv-log
{
"index_patterns": ["csv-log-*"],
"template": {
"settings": {
"number_of_shards": 1
},
"mappings": {
"properties": {
"geoip": {
@ggnanasekaran77
ggnanasekaran77 / mp-csv_to_elastic.py
Last active September 25, 2021 02:00
Multiprocessing CSV to Elastic
from multiprocessing import Pool
import time
import os
import pandas as pd
from elasticsearch import Elasticsearch, helpers
def csvToElastic(file):
client = Elasticsearch("localhost:9200", http_compress=True)
header_list = ["Time", "Url", "Uri", "RemoteIP"]
@ggnanasekaran77
ggnanasekaran77 / esk-sample.json
Last active September 25, 2021 00:47
esk-sample.json
{
"_index": "csv-log-16-0700",
"_type": "_doc",
"_id": "5vX2FXwBBxQZBII86oJ6",
"_version": 1,
"_score": 1,
"_source": {
"AppCode": "****",
"geoip": {
"continent_name": "Asia",
--- # apache_balancer_manager_role do.yml
- name: member_host
debug:
msg: "member_host {{ member_host }}"
- name: "Get the balancer_manager content"
uri:
url: "{{ apache.balancer.url }}"
follow_redirects: yes
return_content: yes
apache:
balancer:
password: xxxxx
url: https://www.xxxx.com/balancer-manager
username: apache
[win]
w101.sample.com
w102.sample.com
w103.sample.com
[wout]
w104.sample.com
[web:children]
win
wout