A Journey of a Thousand Miles Begins with a Single Step

Reindex data from remote cluster

At work I still run the Elasticsearch Cluster in version 5.6.4. While I’m eager to upgrade and keep up the pace, I don’t always have the chance to upgrade immediately. A customer of mine needed a small set of data in Excel. Elasticsearch 6 or moreover Kibana 6 offers the CSV export in the X-Pack extensions. To use that functionality, I needed to export a fragment of desired data from my production cluster. Since the Reindex API allows us to read data from remote and write it, I simply ramped up my private cluster in v 6.1.1 with Docker and started the reindexing.

Read more

No keep alive in Nginx

Providing a HTTP health check service with Nginx, is straightforward. If you do ensure that Nginx closes the HTTP connection instead keeping it alive. The basic option therefore is:

Read more

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