Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- elasticsearch
- PYTHON
- dense_vector
- devtools
- airflow
- json
- Crontab
- Tutorial
- ELK
- OPCUA
- KoA
- CSV
- grok
- windows
- package.json
- filebeat
- venv
- DSL
- query
- framework
- node.js
- typescript
- kibana
- path.data
- logstash
- configure
- 7.7.1
- elastic
- ubuntu
- Data Engineering
Archives
- Today
- Total
Gibbs Kim's playground
[ElasticStack-5] .csv file insert to Elasticsearch via Logstash.conf 본문
Tech 기록지/Elastic Stack
[ElasticStack-5] .csv file insert to Elasticsearch via Logstash.conf
Lio Grande 2020. 4. 6. 17:27
Logstash를 사용하여 파일(대표적으로 .csv)을 Elasticsearch로 업로드할때 사용하는 대표적인 파일명은 다음과 같은 패턴을 가진다 -> logstash2el.conf
.conf 파일은 대표적으로 input, filter, output 을 사용하여 raw data를 입력(input)하고 정제(filter)하며, ES로 파일을 전송(output)한다.
=================== .conf Example ====================
## This is operated in ELK 7.6.2
input {
file {
## Basically, Windows' path like as C:\Users\~
## In Logstash, Windows also follow linux style path
path => "C:/sampleFolder/text.csv"
start_position => "beginning"
## in this case is Winodws
## Linux; sincedb_path => "/dev/null"
sincedb_path => "nul"
}
}
filter {
csv {
separator => ","
columns => "time", "airline", "responsetime"]
}
data {
match => ["time", "yyyy/MM/dd HH:mm:ss Z"]
}
mutate {convert => ["airline", "string"]}
mutate {convert => ["responsetime", "float"]}
}
output {
elasticsearch {
## port is setted internally
hosts => "localhost"
## when you make index patterns in Kibana like below,
## you must use lowercase
index => "logstash2eltest"
}
stdout {
codec => rubydebug
}
}
관련하여 참고할만한 링크들
'Tech 기록지 > Elastic Stack' 카테고리의 다른 글
[ElasticStack-7] Dense Vector in Elasticsearch (0) | 2020.04.29 |
---|---|
[ElasticStack-6] 정규표현식(regex)과 Logstash (0) | 2020.04.23 |
[ElasticStack-4] Windows PowerShell execution policy (feat. Filebeat) (0) | 2020.04.06 |
[ElasticStack-3] Raw .csv data upload from Filebeat to ElasticSearch on Windows 10 (with Filebeat setup) (0) | 2020.04.06 |
[ElasticStack-2] Geo_point mapping template (json format) (0) | 2018.10.31 |