this is my new post here,i am looking forward share my experience and knowledge with community.
I'm using elasticsearch and kibana for logs monitoring and also for this purpose i use the ES-Exporter for catching the exceptions in logs .
I have query like this
GET _search
{
"query": {
"query_string": {
"query": "message:\"com.microsoft.sqlserver.jdbc.SQLServerException\" AND @timestamp:(>=now-1h AND <now)"
}
},
"aggs": {
"application": {
"terms": {
"field": "kubernetes.labels.app.keyword"
}
}
}
}
Can i somehow define some conditions in separate new lines using boolean opertator like below:
GET _search
{
"query": {
"query_string": {
"query": "message:\"com.microsoft.sqlserver.jdbc.SQLServerException\"
AND level: DEBUG
AND threadname: xyz
AND @timestamp:(>=now-1h AND <now)"
}
},
"aggs": {
"application": {
"terms": {
"field": "kubernetes.labels.app.keyword"
}
}
}
}
This would make the query more readable.I tried using \n but without success
The slash operator ("") is used to escape special characters in strings, such as double quotes ("content"). Arguably when using the triple double quotes ("""content""") escaping the single double quotes is not required. Which is why the first one without works. Hope that helps!
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.