我在ES中有一个索引。我需要使用API调用在.kibana中创建相同的索引模式。在此创建中,我什至要设置将成为timestamp列的列。赞赏。
您可以做到,但是您需要自己构建整个结构。索引模式定义如下所示:
PUT .kibana/doc/index-pattern:<some-uuid>
{
"type": "index-pattern",
"updated_at": "2018-01-27T07:12:05.373Z",
"index-pattern": {
"title": "test*",
"timeFieldName": "@timestamp",
"fields": """ ... """,
}
}
title
是索引模式的名称,如果通过UI创建索引模式,则输入的名称与您输入的名称相同timeFieldName
是时间戳字段的名称fields
是一个字符串,其中包含索引模式中所有字段定义的JSON数组(请参见下文)字段定义如下所示:
[
{
"name": "@timestamp",
"type": "date",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": true
},
{
"name": "_id",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false
},
{
"name": "_index",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false
},
{
"name": "_score",
"type": "number",
"count": 0,
"scripted": false,
"searchable": false,
"aggregatable": false,
"readFromDocValues": false
},
{
"name": "_source",
"type": "_source",
"count": 0,
"scripted": false,
"searchable": false,
"aggregatable": false,
"readFromDocValues": false
},
{
"name": "_type",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": true,
"readFromDocValues": false
},
{
"name": "referer",
"type": "string",
"count": 0,
"scripted": false,
"searchable": true,
"aggregatable": false,
"readFromDocValues": false
},
...
]
因此,您需要为每个字段创建此数组,然后对其进行字符串化并将字符串放入fields
字段中。
这是代表索引模式的样本文档:
{
"type": "index-pattern",
"updated_at": "2018-01-27T07:12:05.373Z",
"index-pattern": {
"title": "test*",
"timeFieldName": "@timestamp",
"fields": """[{"name":"@timestamp","type":"date","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"referer","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"referer.keyword","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"status","type":"number","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"url","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"url.keyword","type":"string","count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true}]"""
}
}
如果我定义一个像这样的分层索引数据框: 内容如下所示: 我知道如何提取与给定列对应的数据。例如。对于列: 如何提取符合以下标准集的数据: , , , column , , 列 和 、、列、以及从开始的所有列 是偶数 (顺便说一句,我做了不止一次rtfm,但我真的觉得难以理解。)
我正在尝试使用logstash配置在kibana中可视化mongodb数据。下面是我的配置。我在终端中得到一些输出,它永远循环。我看不到由配置文件中提到的名称创建的任何索引,如果索引是生成的,也没有任何数据。在discover选项卡中没有匹配的结果。如何在Kibana中使配置可视化数据? http://localhost:9200/ayesha_logs/_search?漂亮 终端日志:D,[20
我使用的是弹性6.3.2中的IndexRequest。现在我更改为版本7.6.2。如何使用CreateIndexRequest执行以下相同的步骤? 弹性Rest高级客户端6.3.2代码: 切换到7.6.2后,我无法在CreateIndexRequest中创建类型、id和源。
问题内容: 我已经做过这样的事情才能使用: 而且效果还不错。我只是不确定索引名称的目的-在这种情况下为“ blah”。我读过的东西说要用一个,但我不知道为什么。它似乎没有用在查询中,尽管如果导出架构可以看到它。 那么…索引名称的作用是什么?如果它有助于最终的行看起来像: 问题答案: 索引名称用于引用索引以用于将来的命令。像掉落指数。 http://dev.mysql.com/doc/refman/
问题内容: 我知道如何创建索引 以及如何检查索引是否已存在? 我需要检查它们的存在并创建它们(如果还不存在)。 问题答案: 您可以使用以下查询获取索引列表,它们的表和列: 从那里,您可以按索引名称或所涉及的列检查是否存在,并决定创建/跳过索引。
CreateIndexes 根据struct中的tag来创建索引 CreateUniques 根据struct中的tag来创建唯一索引