A Journey of a Thousand Miles Begins with a Single Step

Pretty print duration

Performing a reindex job in Elasticsearch gives you the time the job took.

Read more

Delete all messages of a chat room

Find ObjectId of the chat room

> db.rooms.find({slug:"elk"}).pretty()
        "_id" : ObjectId("59a666cfa9886c002c30b404"),
        "owner" : ObjectId("59a547c2aed276003facf84f"),
        "name" : "Elasticschrott",
        "slug" : "elk",
        "description" : "Everything about the Elasticsearch Universe, including Logstash, Beats",
        "private" : false,
        "lastActive" : ISODate("2017-08-31T08:46:33.690Z"),
        "created" : ISODate("2017-08-30T07:18:39.885Z"),
        "messages" : [ ],
        "participants" : [ ],
        "archived" : true,
        "__v" : 0

Read more

Unarchive letschat chat room

A chat room in letschat was archived. To revive it we can alter the document in the MongoDB instance.

Read more

Search and Replace with VIM

I got this situation in a log file, where the JSON information is after the grep output of the file name.

Read more

Setup AWS Elasticsearch Service

Running Elasticsearch Service on AWS (Amazon Web Services)

Read more

Timestamps in Painless

In short: Converting a UTC timestamp to a local timestamp (in Switzerland).

Read more

Aggregate data in Elastisearch

Elasticsearch with its Query DSL allows powerful aggregations in order to save documents and disk space. After a certain period of time a certain level of detail is not needed anymore. For instance, I collect on a daily basis statistical data about fraud prevention services.

Read more

Analyze Cluster Reroute

My test cluster health was yellow. The X-Pack Monitoring pointed to some indices, which were yellow.

Read more

Reset Persistent Elasticsearch Cluster Setting

If you setup Elasticsearch to report to a dedicated monitoring cluster

PUT _cluster/settings
  "persistent": {
    "xpack.monitoring.exporters.cloud_monitoring.type": "http",
    "xpack.monitoring.exporters.cloud_monitoring.host": "MONITORING_ELASTICSEARCH_URL",
    "xpack.monitoring.exporters.cloud_monitoring.auth.username": "cloud_monitoring_agent",
    "xpack.monitoring.exporters.cloud_monitoring.auth.password": "MONITORING_AGENT_PASSWORD"

Read more