Thanks for replying.
Let me explain, I have bunch of error logs in which there is a key "service" which describes the error log for particular service or application. For ex. "service":"a-b-c" describes that this error log is of application "a-b-c".
Likewise, there are many application wise error logs but I want to insert logs of application having name "service":"a-b-c" into elastisearch index.
I tried few filters as given in above question but it is inserting all applications log instead specific logs in elastisearch.
I hope this explains. If not let me know what part is confusing!
I want to extract full dump that is all available documents from index "X" using python code and save it to json file. But currently M able to extract few documents only using below command. For this I am using elasticsearch python librarry
res = es.search(index="X",body={"query":{"match_all":{}}})
I would suggest that you open a new topic as this question is unrelated to your problem.
Also, a simple search won't return everything, you are limited to 10000 hits, if you want everything you need to use the Scroll API, with the python library you can use the scan helper.
facing issue in order to apply multiple if conditions. I want to extract logs of name service :a-b-c whose type = "error"
But its not working as expected, basically it is extracting all a-b-c service logs
below is my filter condition
filter {
json {
source => "message"
}
if [service] != "a-b-c"
{
drop {}
}
if [type] != "error"
{
drop()
}
}
If you want to test two conditions at the same time, you need to use the two conditions on the same if.
Your first conditional tests the field service and your second condition test the field type, the first if will drop everything where the value of the service field is not a-b-c and the second if will drop everything where the value of field type is not error, but those conditionals are independent from each other.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.