In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Grok configuration case:
# # Startup file configuration: # Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {}} filter {grok {match = > ["message" "% {IP:clientip}\ [% {HTTPDATE:timestamp}\]\% {QS:referrer}\% {NUMBER:response}\% {NUMBER:bytes}]}} output {stdout {codec = >" rubydebug "}} # # output file content 172.16.213.132 [07/Feb/2018:16:24:19 + 0800]" GET / HTTP/1.1 "403 5039 display content {" @ version "= >" 1 " "@ timestamp" = > 2019-11-10T06:02:42.865Z, "host" = > "localhost.localdomain", "message" = > "172.16.213.132 [07/Feb/2018:16:24:19 + 0800]\" GET / HTTP/1.1\ "403 5039", "timestamp" = > "07/Feb/2018:16:24:19 + 0800", "bytes" = > "5039", "response" = > "clientip" = > "172.16.213.132", "referrer" = > "\" GET / HTTP/1.1\ ""}
Grok filter duplicate fields
# # configuration file # Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {} filter {grok {match = > ["message", "% {IP:clientip}\ [% {HTTPDATE:timestamp}\]\% {QS:referrer}\% {NUMBER:response}\% {NUMBER:bytes}"] remove_field = > ["message"]}} output {stdout {codec = > "rubydebug"}}
Grok with Date time plug-in configuration
# Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {} filter {grok {match = > ["message", "% {IP:clientip}\ [% {HTTPDATE:timestamp}\]\% {QS:referrer}\% {NUMBER:response}\% {NUMBER:bytes}"] remove_field = > ["message"]} date {match = > ["timestamp" "dd/MMMM/yyyy:HH:mm:ss Z"]}} output {stdout {codec = > "rubydebug"}}
Date filter duplicated field configuration
# Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {} filter {grok {match = > ["message", "% {IP:clientip}\ [% {HTTPDATE:timestamp}\]\% {QS:referrer}\% {NUMBER:response}\% {NUMBER:bytes}"] remove_field = > ["message"]} date {match = > ["timestamp" "dd/MMMM/yyyy:HH:mm:ss Z"]} mutate {remove_field = > ["timestamp"]}} output {stdout {codec = > "rubydebug"}}
Comprehensive exercise configuration parameters
# Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {} filter {grok {match = > ["message", "% {IP:clientip}\ [% {HTTPDATE:timestamp}\]\% {QS:referrer}\% {NUMBER:response}\% {NUMBER:bytes}"] remove_field = > ["message"]} date {match = > ["timestamp" "dd/MMMM/yyyy:HH:mm:ss Z"]} mutate {rename = > {"response" = > "response_new"} gsub = > ["referrer", "\", ""] remove_field = > ["timestamp"] split = > ["clientip", "."]} output {stdout {codec = > "rubydebug"}}
Operation mode of Geoip geolocation plug-in
# Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {} filter {grok {match = > ["message", "% {IP:clientip}\ [% {HTTPDATE:timestamp}\]\% {QS:referrer}\% {NUMBER:response}\% {NUMBER:bytes}"] remove_field = > ["message"]} date {match = > ["timestamp" "dd/MMMM/yyyy:HH:mm:ss Z"} mutate {remove_field = > ["timestamp"]} geoip {source = > "clientip" database = > "/ usr/local/include/GeoLite2-ASN_20191105/GeoLite2-ASN.mmdb"}} output {stdout {codec = > "rubydebug"}}
Geoip outputs specified attribute values
# Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {} filter {grok {match = > ["message", "% {IP:clientip}\ [% {HTTPDATE:timestamp}\]\% {QS:referrer}\% {NUMBER:response}\% {NUMBER:bytes}"] remove_field = > ["message"]} date {match = > ["timestamp" "dd/MMMM/yyyy:HH:mm:ss Z"]} mutate {remove_field = > ["timestamp"]} geoip {source = > "clientip" # database = > "/ usr/local/include/GeoLite2-Country_20191015/GeoLite2-Country.mmdb" database = > "/ usr/local/include/GeoLite2-City_20191105/GeoLite2-City.mmdb" fields = > ["city_name", "region_name", "country_name", "ip", "latitude", "longitude" "timezone"]} output {stdout {codec = > "rubydebug"}} Simulation data: 36.7.152.182 [07/Feb/2018:16:24:19 + 0800] "GET / HTTP/1.1" 403 5039
Comprehensive actual combat
# Sample Logstash configuration for creating a simple# Beats-> Logstash-> Elasticsearch pipeline.input {stdin {} filter {grok {match = > {"message" = > "% {TIMESTAMP_ISO8601:localtime}\ |\ |% {IP:clientip}\ |\ ~\ |% {GREEDYDATA:http_user_agent}\ |% {GREEDYDATA:url}\ |\ ~\ |% {GREEDYDATA:mediaid}\ |\ ~\ |% {GREEDYDATA:osid}"} remove_field = > [ "message"]} date {match = > ["localtime" "yyyy-MM-dd'T'HH:mm:ssZZ"] target = > "@ timestamp"} mutate {remove_field = > ["localtime"]} geoip {source = > "clientip" # database = > "/ usr/local/include/GeoLite2-Country_20191015/GeoLite2-Country.mmdb" database = > "/ usr/local/include/GeoLite2-City_20191105/GeoLite2-City.mmdb" fields = > ["city_name", "region_name", "country_name", "ip", "latitude" "longitude", "timezone"]}} output {stdout {codec = > "rubydebug"} example: 2018-02-09T10:57:42+08:00 | ~ | 123.87.240.97 | ~ | Mozilla/5.0 (iPhone) CPU iPhone OS 11 / 2 / 2 like Mac OS X) AppleWebKit/604.4.7 Version/11.0 Mobile/15C202 Safari/604.1 | ~ | http://m.sina.cn/cm/ads_ck_wap.html|~|12434785489009|~|DF45566587855P
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.