Logstash “日志存储配置”;如果字符串包含…”;
那么,假设我有一部分日志行,看起来像这样:Logstash “日志存储配置”;如果字符串包含…”;,logstash,logstash-grok,logstash-configuration,Logstash,Logstash Grok,Logstash Configuration,那么,假设我有一部分日志行,看起来像这样: GET /restAPI/callMethod1/8675309 GET匹配一个http方法,GET被提取,其余的匹配一个URI,也被提取。现在在logstash配置中,让我们假设我想做这样的事情 if [METHOD] == "GET" { if [URI] (CONTAINS <--Is there a way to do this?) =="restAPI/callMethod1"{ .... if[METHOD
GET /restAPI/callMethod1/8675309
GET匹配一个http方法,GET被提取,其余的匹配一个URI,也被提取。现在在logstash配置中,让我们假设我想做这样的事情
if [METHOD] == "GET" {
if [URI] (CONTAINS <--Is there a way to do this?) =="restAPI/callMethod1"{
....
if[METHOD]=“GET”{
如果[URI](包含,您只需像这样使用=~
(regexp)运算符即可实现它(请参阅):
if [METHOD] == "GET" {
if [URI] =~ /restAPI\/callMethod1/ {
...