Skip to content

Instantly share code, notes, and snippets.

View Kumawatlalit912's full-sized avatar
🎯
Focusing

Kumawat Lalit Kumawatlalit912

🎯
Focusing
View GitHub Profile
@Kumawatlalit912
Kumawatlalit912 / roles.yml
Created February 10, 2023 05:57
for elastic user roles
# The default roles file is empty as the preferred method of defining roles is
# through the API/UI. File based roles are useful in error scenarios when the
# API based roles may not be available.
admins:
cluster:
- all
indices:
- names:
@Kumawatlalit912
Kumawatlalit912 / elastic.yml
Created February 10, 2023 06:00
elastic yml file
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
@Kumawatlalit912
Kumawatlalit912 / useradd.yml
Created February 10, 2023 06:05
to ass user in elastic
make sure to go in users_roles and add admins as (user created)
./elasticsearch-users useradd kumawatlalit -p kumawat -r network,monitoring
@Kumawatlalit912
Kumawatlalit912 / docker-compose.yml
Created February 13, 2023 08:57
run elastic and kibana using docker container
//docker compose up ---->after saving this run this in the same folder --> you can use vs code
version: "3.7"
services:
es01:
image: "docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2"
ports:
- "9200:9200"
- "9300:9300"
environment:
@Kumawatlalit912
Kumawatlalit912 / docker-compose1.yml
Created February 14, 2023 06:22
docker compost yml file
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.1
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
@Kumawatlalit912
Kumawatlalit912 / docker-compose2.yml
Created February 15, 2023 23:55
updated docker-compose.yml file for version 3
#uncomment things you want to use and comment that you dont want
#Give it A star
version: "3"
services:
#mongodb:
#container_name: mongodb
#image: mongo:latest
#ports:
@Kumawatlalit912
Kumawatlalit912 / analyzers.json
Created February 20, 2023 07:26
elastic analyzers
put hola/
{
"settings":{
"analysis":{
"analyzer":{
"my-analyzer":{
"tokenizer":"my-tokenizer",
"filter":["lowercase"]
},
@Kumawatlalit912
Kumawatlalit912 / insertLargeCsv.js
Created February 24, 2023 06:15
how to insert large csv dataset in elastic using nodejs
const { Client } = require('@elastic/elasticsearch');
const fs = require('fs');
const readline = require('readline');
const csv = require('csv-parser');
const client = new Client({ node: 'http://localhost:9200' });
const filePath = '/path/to/large/csv/file'; // Replace with the path to your CSV file
const chunkSize = 100000; // Replace with the desired chunk size
@Kumawatlalit912
Kumawatlalit912 / docker-compose.yaml
Created February 27, 2023 19:58
elastic and kibana configuration in docker,docker-compose.yaml
version: '3'
services:
elasticsearch1:
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.1
container_name: elasticsearch1
environment:
- discovery.type=zen
- cluster.name=docker-cluster
- node.name=node-1
@Kumawatlalit912
Kumawatlalit912 / docker-compose.yaml
Created February 27, 2023 20:00
basic yaml file for elastic,kibana,mongodb
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.1
container_name: elasticsearch
environment:
- discovery.type=single-node
ports:
- 9200:9200