zoukankan      html  css  js  c++  java
  • 字符串转换为float<2>

    Configuration OK
    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:58:43.973Z",
                "host" => "0.0.0.0",
        "request_time" => 123.456,
                "test" => "aaaaaavvv"
    }
    ^CSIGINT received. Shutting down the agent. {:level=>:warn}
    stopping pipeline {:id=>"main"}
    ^CSIGINT received. Terminating immediately.. {:level=>:fatal}
    zjtest7-frontend:/usr/local/logstash-2.3.4/config# ^C
    zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat g01.conf 
    input {stdin{}}
     filter {
        grok {
         match => {
         "message" =>"s+(?<request_time>d+(?:.d+)?)s+"}
         add_field =>["[test]","aaaaaavvv"]
         }
           mutate {  
                            convert => [ "request_time", "float"]  
                   }  
     }
    output {
          stdout {
                   codec => rubydebug{}
                    } 
    }
    

  • 相关阅读:
    一些基本概念
    Linux命令
    浮点型数据
    编码习惯
    VC++ Debug编译方式
    程序和进程
    文件和目录
    登录
    c#发送http请求注意
    html5获取图片的宽高
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6199224.html
Copyright © 2011-2022 走看看