不要急,总有办法的

history log 分割问题

Logstash | 作者 jianfzhu | 发布于2018年02月09日 | 阅读数:2151

请问在logstash中分割filebeat送上来的数据。
比如我想提取source 中的用户,如admin, k1 .... 还有分割message, 把时间提取出来。
有没有表达式的教程?
 
{
  "@timestamp": "2018-02-09T02:34:35.645Z",
  "@metadata": {
    "beat": "filebeat",
    "type": "doc",
    "version": "6.1.2"
  },
  "source": "/home/admin/.bash_history",
  "offset": 596,
  "message": "#1518139792\nexit",
  "tags": [
    "history"
  ],
  "prospector": {
    "type": "log"
  },
  "beat": {
    "hostname": "elk",
    "version": "6.1.2",
    "name": "elk"
  }
}
{
  "@timestamp": "2018-02-09T02:34:35.660Z",
  "@metadata": {
    "beat": "filebeat",
    "type": "doc",
    "version": "6.1.2"
  },
  "beat": {
    "version": "6.1.2",
    "name": "elk",
    "hostname": "elk"
  },
  "source": "/home/k1/.history",
  "offset": 150,
  "message": "#+1518057299\nexit",
  "tags": [
    "history"
  ],
  "prospector": {
    "type": "log"
  }
}
 
已邀请:

要回复问题请先登录注册