zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat g01.conf
input {stdin{}}
filter {
grok {
match => {
"message" =>"\s+(?<request_time>\d+(?:\.\d+)?)\s+"
}
}
mutate {
convert => [ "request_time", "float"]
}
}
output {
stdout {
codec => rubydebug{}
}
} zjtest7-frontend:/usr/local/logstash-2.3.4/config# ../bin/logstash -f g01.conf
Settings: Default pipeline workers: 1
Pipeline main started
begin 123.456 end
{
"message" => "begin 123.456 end",
"@version" => "1",
"@timestamp" => "2016-09-11T05:31:32.576Z",
"host" => "0.0.0.0",
"request_time" => "123.456"
} 此时 "request_time" => "123.456" 输出的是字符串 zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat g01.conf
input {stdin{}}
filter {
grok {
match => {
"message" =>"\s+(?<request_time>\d+(?:\.\d+)?)\s+"
}
}
mutate {
convert => [ "request_time", "float"]
}
}
output {
stdout {
codec => rubydebug{}
} zjtest7-frontend:/usr/local/logstash-2.3.4/config# ../bin/logstash -f g01.conf
Settings: Default pipeline workers: 1
Pipeline main started
begin 123.456 end
{
"message" => "begin 123.456 end",
"@version" => "1",
"@timestamp" => "2016-09-11T05:34:13.040Z",
"host" => "0.0.0.0",
"request_time" => 123.456
} 把字符串转换为 float型

最新文章

  1. Asp.Net Core 项目实战之权限管理系统(0) 无中生有
  2. MyBatis源码分析-SQL语句执行的完整流程
  3. 自己总结的web前端知识体系大全【欢迎补充】
  4. Hibernate类中集合的映射
  5. directX学习系列8 颜色融合(转)
  6. handler机制的原理
  7. http-equiv
  8. Cassandra1.2文档学习(14)—— 事务和并发控制
  9. javascript中的 &amp;&amp; 与 || 的运用
  10. RabbitMQ Management HTTP API--官方文档
  11. “The SQL Server license agreenment cannot be located for the selected edition.”MSSQL安装问题
  12. 微信公众平台开发(一) ——实现URL接入
  13. c#添加事物(全部执行和带保存点的执行)
  14. IOS之【地图MapKit】
  15. SQL Server学习之路(七):Python3操作SQL Server数据库
  16. python模块安装报错 :error: command &#39;gcc&#39; failed with exit status 1
  17. Oracle:对用户的CREATE、ALTER、GRANT、REVOKE操作练习
  18. [USACO 04OPEN]MooFest
  19. 爬虫之proxy(代理)
  20. KeepAlived(三):vrrp实例故障转移(keepalived+haproxy)

热门文章

  1. library cache: mutex X
  2. NOI2011 兔兔与蛋蛋游戏
  3. Underscore.js(1.7.0) 中文文档 Underscore.js 入门
  4. C++中的重载、覆盖、隐藏
  5. python字符串(移除空白,长度,索引,分割,切片,拼接,格式化输出)
  6. C# 图结构操作
  7. javaweb文件下载
  8. iOS 部分问题总结2 - 苹果审核篇
  9. mysql学习之五:sql语句学习3
  10. 设计: ListView 接口,and the missing read-only interfaces in java collection framework