write in to a CSV file
Posted: Wed Oct 09, 2019 2:35 am
Hi
From the following query, I am able to search specific data accurately in incoming logs.
(host="IP_1" & host="IP_2" & host="IP_3" & host="IP_4") && ("String_1:" && "String_2")
I want to write those captured data in to a csv file. I have installed CSV_OUTPUT plugin.
https://www.elastic.co/guide/en/logstas ... s-csv.html
My question is, how can I send those selected data to the CSV file at the same time?
I found some articles online related my requirement. But most of them are not real time creating CSV files. those examples says, We have to give a specific index file to generate the csv.
I want to write in to the csv file real time, whenever searching criteria matched, it has to be written in to the csv.
can we use elasticsearch input plugin ;
elasticsearch {
hosts => "localhost:9200"
index => "index-file-name"
query => '
{"query": {
(host="IP_1" & host="IP_2" & host="IP_3" & host="IP_4") && ("String_1:" && "String_2")}
}
}
If we can use it, then what would be the search query? Can we use same query as I have used to search data?
Once found the data using elasticsearch plugin, then how can I forward the logs to csv-ouput plugin?
Can you please give me a little guide.
Thank you
Luke.
From the following query, I am able to search specific data accurately in incoming logs.
(host="IP_1" & host="IP_2" & host="IP_3" & host="IP_4") && ("String_1:" && "String_2")
I want to write those captured data in to a csv file. I have installed CSV_OUTPUT plugin.
https://www.elastic.co/guide/en/logstas ... s-csv.html
My question is, how can I send those selected data to the CSV file at the same time?
I found some articles online related my requirement. But most of them are not real time creating CSV files. those examples says, We have to give a specific index file to generate the csv.
I want to write in to the csv file real time, whenever searching criteria matched, it has to be written in to the csv.
can we use elasticsearch input plugin ;
elasticsearch {
hosts => "localhost:9200"
index => "index-file-name"
query => '
{"query": {
(host="IP_1" & host="IP_2" & host="IP_3" & host="IP_4") && ("String_1:" && "String_2")}
}
}
If we can use it, then what would be the search query? Can we use same query as I have used to search data?
Once found the data using elasticsearch plugin, then how can I forward the logs to csv-ouput plugin?
Can you please give me a little guide.
Thank you
Luke.