docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -v /home/eve/Documentos/shop_brasil/shop_brasil_ocr/data/database/:/var/lib/elasticsearch --name elk2 sebp/elk
PUT shopping_brasil
PUT shop_brasil/_mapping
{
"properties": {
"IDPRDT": {
"type": "text"
},
"MARCA": {
"type": "text"
},
"MODELO": {
"type": "text"
},
"DESCRICAO": {
"type": "text"
},
"IDMARCA": {
"type": "text"
},
"IDSEGMENTOBASE": {
"type": "text"
},
"SEGMENTOBASE": {
"type": "text"
},
"IDGRUPOBASE": {
"type": "text"
},
"GRUPOBASE": {
"type": "text"
},
"GENERICO": {
"type": "text"
},
"SITUACAO": {
"type": "text"
},
"ADS": {
"type": "text"
},
"UNIDADE": {
"type": "text"
},
"IDTIPOUNIDADE": {
"type": "text"
},
"APRESENTACAO": {
"type": "text"
}
}
}
POST /shop_brasil/_close
PUT shop_brasil/_settings
{
"analysis": {
"filter": {
"brazilian_stop": {
"type": "stop",
"stopwords": "_brazilian_"
},
"brazilian_keywords": {
"type": "keyword_marker",
"keywords": ["exemplo"]
},
"brazilian_stemmer": {
"type": "stemmer",
"language": "brazilian"
}
},
"analyzer": {
"rebuilt_brazilian": {
"tokenizer": "standard",
"filter": [
"lowercase",
"brazilian_stop",
"brazilian_keywords",
"brazilian_stemmer"
]
}
}
}
}
POST /shop_brasil/_open
PUT /_settings
{
"index" : {
"number_of_replicas" : 0
}
}
input {
file {
path => "/var/lib/elasticsearch/CLEAN_DATA_BASE_BRASIL.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ";"
columns => ["IDPRDT","MARCA","MODELO","DESCRICAO","IDMARCA","IDSEGMENTOBASE","SEGMENTOBASE","IDGRUPOBASE","GRUPOBASE","GENERICO","SITUACAO","ADS","UNIDADE","IDTIPOUNIDADE","APRESENTACAO"]
quote_char => "'"
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "shopping_brasil"
}
stdout {}
}
/etc/init.d/logstash stop
/opt/logstash/bin/logstash -f insert_data.conf