"osquery": {
"result": {
"name": "pack_it-compliance_os_version",
"unix_time": 1540281585,
"action": "snapshot",
"epoch": 0,
"counter": 0,
"calendar_time": "Tue Oct 23 07:59:45 2018 UTC",
"snapshot": [
{
"patch": "1611",
"major": "7",
"minor": "3",
"build": "",
"codename": "",
"name": "CentOS Linux",
"platform_like": "rhel",
"version": "CentOS Linux release 7.3.1611 (Core)",
"platform": "rhel"
}
],
"host_identifier": "xxxx.xxxxx"
}
},
snapshot中有[] 怎么处理解析 mapping ?
_ingest/pipeline 怎么破这玩意?
filebeat直接写入ES
"result": {
"name": "pack_it-compliance_os_version",
"unix_time": 1540281585,
"action": "snapshot",
"epoch": 0,
"counter": 0,
"calendar_time": "Tue Oct 23 07:59:45 2018 UTC",
"snapshot": [
{
"patch": "1611",
"major": "7",
"minor": "3",
"build": "",
"codename": "",
"name": "CentOS Linux",
"platform_like": "rhel",
"version": "CentOS Linux release 7.3.1611 (Core)",
"platform": "rhel"
}
],
"host_identifier": "xxxx.xxxxx"
}
},
snapshot中有[] 怎么处理解析 mapping ?
_ingest/pipeline 怎么破这玩意?
filebeat直接写入ES
9 个回复
rochy - rochy_he
赞同来自:
你可以通过设置 snapshot 的 properties 来设置内部包含的字段的具体映射
详细参考:https://www.elastic.co/guide/e ... arams
rochy - rochy_he
赞同来自:
zqc0512 - andy zhou
赞同来自:
zqc0512 - andy zhou
赞同来自:
"properties": {
"result": {
"properties": {
"name": {
"type": "keyword",
"ignore_above": 1024
},
"snapshot": {
"properties": {
"patch": {
"type": "keyword",
"ignore_above": 1024
},
"major": {
"ignore_above": 1024,
"type": "keyword"
},
"minor": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"platform_like": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"ignore_above": 1024,
"type": "keyword"
},
"platform": {
"ignore_above": 1024,
"type": "keyword"
},
"codename": {
"type": "keyword",
"ignore_above": 1024
}
}
},
"action": {
"ignore_above": 1024,
"type": "keyword"
},
"host_identifier": {
"ignore_above": 1024,
"type": "keyword"
},
"unix_time": {
"type": "long"
},
"calendar_time": {
"type": "keyword",
"ignore_above": 1024
}
}
}
}
}
}
}
},
"aliases": {}
}
这mapping应该怎么修改? snapshot 我是按照json写的。现在elastic点不进去。
不晓得这里应该怎么写
zqc0512 - andy zhou
赞同来自:
"snapshot": {
"type": "nested",
"properties": {
"patch": {
"type": "keyword",
"ignore_above": 1024
},
zqc0512 - andy zhou
赞同来自:
类似:osquery.result.snapshot.patch: "1611",
这个怎么破?
mapping is
"osquery": {
"properties": {
"result": {
"properties": {
"name": {
"type": "keyword",
"ignore_above": 1024
},
"snapshot": {
"type": "nested",
"dynamic": true,
"properties": {
"build": {
"type": "keyword",
"ignore_above": 1024
},
"codename": {
"ignore_above": 1024,
"type": "keyword"
},
"major": {
"ignore_above": 1024,
"type": "keyword"
},
"minor": {
"ignore_above": 1024,
"type": "keyword"
},
"name": {
"ignore_above": 1024,
"type": "keyword"
},
"patch": {
"ignore_above": 1024,
"type": "keyword"
},
"platform": {
"ignore_above": 1024,
"type": "keyword"
},
"platform_like": {
"type": "keyword",
"ignore_above": 1024
},
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"action": {
"ignore_above": 1024,
"type": "keyword"
},
"hostIdentifier": {
"ignore_above": 1024,
"type": "keyword"
},
"host_identifier": {
"ignore_above": 1024,
"type": "keyword"
},
"epoch": {
"ignore_above": 1024,
"type": "keyword"
},
"counter": {
"ignore_above": 1024,
"type": "keyword"
},
"unix_time": {
"type": "long"
},
"unixtime": {
"type": "long"
},
"calendar_time": {
"type": "keyword",
"ignore_above": 1024
}
}
}
}
}
}
}
},
"aliases": {}
}
zqc0512 - andy zhou
赞同来自:
{"snapshot":[{"build":"","codename":"","major":"7","minor":"3","name":"CentOS Linux","patch":"1611","platform":"rhel","platform_like":"rhel","version":"CentOS Linux release 7.3.1611 (Core)"}],"action":"snapshot","name":"pack_it-compliance_os_version","hostIdentifier":"xxx","calendarTime":"Tue Oct 23 12:45:28 2018 UTC","unixTime":1540298728,"epoch":0,"counter":0,"decorations":{"host_uuid":"xxxxx","username":"root"}}
rochy - rochy_he
赞同来自:
暂时没看明白你到底要做什么
zqc0512 - andy zhou
赞同来自:
osquery.result.snapshot.patch: "1611",
osquery.result.snapshot.minor: "3",
……
现在他放在里面一起了。
"snapshot": [
{
"patch": "1611",
"minor": "3",
"major": "7",
"build": "",
"codename": "",
"name": "CentOS Linux",
"platform_like": "rhel",
"version": "CentOS Linux release 7.3.1611 (Core)",
"platform": "rhel"
}
],
我kibana上面图表展示不出来。