input api output elasticsearch
input
{
http_poller
{
urls =>
{
myurl => "http://api.openweathermap.org/data/2.5/weather?q=Seoul&appid=5af8b7bbeacd98abe5e5e4b84a46d520"
}
schedule =>
{
cron => "*/1 * * * * UTC"
}
codec => "json"
}
}
filter
{
mutate
{
copy =>
{
"[main][pressure]" => "[main_pressure]"
"[main][humidity]" => "[main_humidity]"
"[main][temp_max]" => "[main_temp_max]"
"[main][grnd_level]" => "[main_grnd_level]"
"[main][feels_like]" => "[main_feels_like]"
"[main][temp]" => "[main_temp]"
"[main][temp_min]" => "[main_temp_min]"
"[main][sea_level]" => "[main_sea_level]"
"[clouds][all]" => "[clouds_all]"
"[rain][1h]" => "[rain_1h]"
"[wind][speed]" => "[wind_speed]"
"[wind][deg]" => "[wind_deg]"
"[sys][id]" => "[sys_id]"
"[sys][sunrise]" => "[sys_sunrise]"
"[sys][type]" => "[sys_type]"
"[sys][country]" => "[sys_country]"
"[sys][sunset]" => "[sys_sunset]"
"[coord][lon]" => "[coord_lon]"
"[coord][lat]" => "[coord_lat]"
}
convert =>
{
"main_pressure" => "float"
"main_feels_like" => "float"
"main_temp_min" => "float"
"main_temp" => "float"
"main_temp_max" => "float"
"main_humidity" => "float"
"main_grnd_level" => "float"
"main_sea_level" => "float"
"clouds_all" => "float"
"rain_1h" => "float"
"wind_speed" => "float"
"wind_deg" => "float"
"sys_id" => "float"
"sys_sunrise" => "float"
"sys_type" => "float"
"sys_country" => "string"
"sys_sunset" => "float"
"coord_lon" => "float"
"coord_lat" => "float"
}
remove_field => ["main", "clouds", "rain", "wind", "sys", "coord", "weather"]
}
}
output
{
elasticsearch
{
hosts => "elasticsearch:9200"
index => "api_es"
}
}
'Database > ElasticSearch' 카테고리의 다른 글
[logstash] input file output mysql pipeline .conf (0) | 2021.09.20 |
---|---|
[logstash] input file output minio pipeline .conf (0) | 2021.09.20 |
[logstash] input api output kafka pipeline .conf (0) | 2021.09.20 |
[logstash] input minio output file pipeline .conf (0) | 2021.09.20 |
[logstash] input api output minio pipeline .conf (0) | 2021.09.20 |