【问题标题】:Indexing In ElasticSearch For Auditing在 ElasticSearch 中为审计编制索引
【发布时间】:2019-12-07 19:18:54
【问题描述】:

有一个基于微服务的架构,其中每个服务都有不同类型的实体。例如:

服务 1:

{
    "entity_type": "SKU",
    "sku": "123",
    "ext_sku": "201",
    "store": "1",
    "product": "abc",
    "timestamp": 1564484862000
}

服务 2:

{
    "entity_type": "PRODUCT",
    "product": "abc",
    "parent": "xyz",
    "description": "curd",
    "unit_of_measure": "gm",
    "quantity": "200",
    "timestamp": 1564484863000
}

服务 3:

{
  "entity_type": "PRICE",
  "meta": {
    "store": "1",
    "sku": "123"
  },
  "price": "200",
  "currency": "INR",
  "timestamp": 1564484962000
}

服务 4:

{
  "entity_type": "INVENTORY",
  "meta": {
    "store": "1",
    "sku": "123"
  },
  "in_stock": true,
  "inventory": 10,
  "timestamp": 1564484864000
}

我想编写一个由 elasticsearch 支持的 Audit Service,它将摄取所有这些实体,并将基于 entity_typestore、@987654327 进行索引@, timestamp.

弹性搜索在这里会是一个不错的选择吗?另外,索引将如何工作?因此,例如,如果我搜索store=1,它应该将所有具有store 的不同实体返回为1。其次,我能否获取 2 timestamps 之间的所有实体?

ES 和 Kibana(可视化)在这里会是不错的选择吗?

【问题讨论】:

    标签: elasticsearch indexing kibana auditing audit-logging


    【解决方案1】:

    是的。你的用例几乎就是described in the docs under filter context

    在过滤器上下文中,查询子句回答“这样做 文档匹配这个查询子句?”答案很简单,是或 否 — 不计算分数。过滤上下文主要用于 过滤结构化数据,例如

    • 此时间戳是否在 2015 年到 2016 年的范围内?
    • 状态字段是否设置为published

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-16
      • 2021-12-17
      • 2021-07-04
      • 2017-02-26
      • 2021-10-02
      • 1970-01-01
      相关资源
      最近更新 更多