Command:
tcpdump -A 'tcp port 9200 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)' -i lo0 | egrep -A 5 -i "POST /_bulk"
Expected output (w/ Content-Length):
...U...5POST /_bulk HTTP/1.1
Connection: Keep-Alive
Command:
tcpdump -A 'tcp port 9200 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)' -i lo0 | egrep -A 5 -i "POST /_bulk"
Expected output (w/ Content-Length):
...U...5POST /_bulk HTTP/1.1
Connection: Keep-Alive
e.g Delete Logstash logs after 45 days
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.action.type = Delete
appender.rolling.strategy.action.basepath = ${sys:ls.logs}
appender.rolling.strategy.action.condition.type = IfFileName
appender.rolling.strategy.action.condition.glob = logstash-${sys:ls.log.format}-*
appender.rolling.strategy.action.condition.nested_condition.type = IfLastModified
appender.rolling.strategy.action.condition.nested_condition.age = 45D
// - Try to update matching documents using _update_by_query (https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html) | |
// - If no matching documents, index a new one with desired data | |
// | |
// Install Elasticsearch Node.js client: npm install @elastic/elasticsearch | |
const { Client } = require('@elastic/elasticsearch') | |
const client = new Client({ node: 'http://localhost:9200' }) | |
client.updateByQuery({ |
This watcher check every 5 minutes if the number of Logstash monitoring events are below 1 which means Logstash monitoring is in trouble.
"watch" : {
"trigger" : {
"schedule" : {
"interval" : "5m"
}
},
"input" : {
{
"trigger": {
"schedule": {
"interval": "30m"
}
},
"input" : {
"http" : {
"request" : {
I hereby claim:
To claim this, I am signing this object:
"transform": {
"script": {
"source": "return [ 'dups': ctx.payload.aggregations.my_buckets.buckets.stream().filter(t -> { return t.doc_count > 1 }).map(t -> { return ['key': t.key ] }).collect(Collectors.toList()) ]",
"lang": "painless"
}
}
curl -o /dev/null -s -w 'Establish Connection: %{time_connect}s\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n' https://your_endpoint_url:port