Spawnrider
Spawnrider

Reputation: 1773

Use different time-field name with mutiple mappings in ElasticSearch index

I setted up an MongoDB, ElasticSearch 1.7.2 & Kibana 4.1.2 stack in order to visualize reports from Mongo collections. I am using Mongo-Connector in order to populate Elastic Search index from Mongo Redolog.

My setup :

I configured the DB index and use 'createAt' (from Col1 Mongo data collection) as the Time-field name in Kibana Indices panel.

I want to visualize a bar chart on 'Col2' and filter using a specific date range on 'Col2'>'startDate' time field.

My questions :

  1. Is it possible to use startDate as the filter ? I saw on the _msearch generated ElasticSearch request that the filter is the Time-field setted for this index (i.e. createdAt). I found a workaround by specify the 5 last years for the createdAt in order to not restrict my data range on this time field value.
  2. Can I modify these fields in the exported JSON formatted ES request and reimport it?

Thanks in advance for your help, Do not hesitate to ask for additional information.

Upvotes: 1

Views: 412

Answers (2)

Spawnrider
Spawnrider

Reputation: 1773

I just found myself a solution.

You just have to specify the source and destination namespace set as mongo connector command line arguments :

mongo-connector -m bdd.myhost.fr:27017 -t reporting.myhost.fr:9200 -d elastic_doc_manager --auto-commit-interval=0 --namespace-set DB.Col1,DB.Col2 --dest-namespace-set DB_Col1.Col1,DB_Col2.Col2

Upvotes: 1

Alain Collins
Alain Collins

Reputation: 16362

Each Kibana index pattern is tied to one date field. So, to use a second date field, you need to use a second index pattern.

I've seen people do "logstash-YYYY.mm.dd" and then also have "logstash-*".

It might also be possible with index aliases.

Upvotes: 0

Related Questions