Wednesday, 29 December 2021

ELK: Kibana graph chart & elastic-search mapping

I'd like to ask for advice about Kibana's graph visualization & ElasticSearch mapping with join types.

I am having different entities, let say pets (let's call them major entities) and their owners (minor entity).

I am inserting pets in PETS index and put owners in separate index of OWNERS. So some pets have a property that can be connected/join with the following (only one) owner.

Like this:

pets

{ 
  id: 1,
  name: 'Pikacho',
  ownerId: 1
}

owner

{ 
  id: 1,
  name: 'Rachel',
  petId: 1
}

Actually I am free to use every structure I want, even nested owner documents inside every pet. The real question is how to achieve the best case for graph data

Owners are really a separate entity and I don't need them in the business logic of my app, but sometimes, as a user I'd like to check in Kibana's UI via graph chart how many pets have one owner and so on.

enter image description here

So my question is: Are there any restrictions on data inserting (with.index method) via ElasticSearch driver for node.js, if I'd like to build a graph chart?

  • Should I create index via .create index and mark every field with correct mapping or I can just write them as usual in Elastic and connect necessary field inside Kibana by the result?
  • How to use the join relation correctly in this case if I have to use it for graph charts and should I use them at all?
  • Should I have two different indexes for performable graph chats, or it's better to have a document-oriented way with:
{
  id: 1,
  name: 'Pikachoo',
  owner: {
    id: 1,
    name: 'Rachel'
  }
}

My Elastic & Kibana versions are 7.16+ (current) I'll be glad to have any example provided.



from ELK: Kibana graph chart & elastic-search mapping

No comments:

Post a Comment