# Grok filter working in debugger but not getting parsed with Logstash

**URL:** <https://discuss.elastic.co/t/grok-filter-working-in-debugger-but-not-getting-parsed-with-logstash/261006>\
**Category:** Logstash\
**Created:** [January 13, 2021, 1:52pm UTC](https://discuss.elastic.co/t/grok-filter-working-in-debugger-but-not-getting-parsed-with-logstash/261006 "2021-01-13T13:52:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijayakumar.cfis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vijayakumar.cfis/32/82185_2.png) [@vijayakumar.cfis](https://discuss.elastic.co/u/vijayakumar.cfis)\
**Post date:** [January 13, 2021, 1:52pm UTC](https://discuss.elastic.co/t/grok-filter-working-in-debugger-but-not-getting-parsed-with-logstash/261006/1 "2021-01-13T13:52:32Z")

</div>

Hi Team,

I am trying to parse the below log entries using Grok.

```auto
<158>Dec 03 04:50:03 AB-AWSA-01.abcd.xxxxxxxxxxxxxxx.com SIEMAccessLogs: Info: 10.0.0.1 "abcd\abcd@abcd.xxxxxxxxxxxxxxx.com" - [03/Dec/2020:04:50:01 +0000] "TCP_CONNECT 13.110.3.230:443" 200 760 TCP_MISS:DIRECT 187 PASSTHRU_CUSTOMCAT_7-WhiteList-WhiteList.IdProfile-WhitelistExclusion-NONE-NONE-DefaultGroup-NONE <"C_Whit",-,-,"-",-,-,-,-,"-",-,-,-,"-",-,-,"-","-",-,-,"-",-,"-","-","-","-","-","-","-",32.51,0,-,"-","-",-,"-",-,-,"-","-",-,-,"-",-> -

<158>Dec 02 23:57:35 AB-AWSA-01.abcd.xxxxxxxxxxxxxxx.com SIEMAccessLogs: Info: 10.0.0.1 - - [02/Dec/2020:23:57:35 +0000] "GET https://tags.xyz.com:443/site/19505?id=y-kXhsUBJ1lxVW22_Nvzyc_JsU0HWPN9xDxX8-" 200 62 TCP_MISS_SSL:DIRECT 192 DEFAULT_CASE_12-DefaultGroup-DefaultGroup-DefaultGroup-NONE-NONE-DefaultGroup-NONE <"IW_comp",1.7,1,"-",0,0,0,1,"-",-,-,-,"-",1,-,"-","-",-,-,"IW_comp",-,"Unknown","Computers and Internet","-","Unknown","Unknown","-","-",25.92,0,-,"Unknown","-",-,"-",-,-,"-","-",-,-,"-",-> -

```

I am using the below config to parse. The pattern works in Grok debugger, but not getting parsed with Logstash. Kindly help.

```auto
input {
  file {
   path => "/home/elk_user/sample/wsa_sample.log"
   start_position => "beginning"
   sincedb_path => "/dev/null"
  }
}
filter {
    grok {
      match => {"message" => "<.* %{IPORHOST:host} (?<Facility>[^\d]*) %{IPORHOST:source_ip} (\"(?<domain>[^\"][^\\]*)\\(?<user>[^@]*)@.*\"|(?<domain>[-])) .* \[%{HTTPDATE:date}\] \"%{WORD:command} ((%{IPORHOST:destination_ip}:%{POSINT:destination_port})|(?<url>[^\"]*))\" %{NUMBER:response_code} .* (?<query_response>[^:]*):.* (?:\d*) (?<category>[^-]*)-%{GREEDYDATA:policy_name}-(?:.*)-(?:.*)-(?:.*)-(?:.*) < "}
      add_tag => ["got_wsa", "parse_done"]
      tag_on_failure => ["_defaultparse"]
      remove_field => ["message"]
    }
}
output {
  elasticsearch { 
  hosts => ["localhost:9200"] 
  index => "wsa-%{+YYYY.MM.dd}"
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 10, 2021, 1:52pm UTC](https://discuss.elastic.co/t/grok-filter-working-in-debugger-but-not-getting-parsed-with-logstash/261006/2 "2021-02-10T13:52:43Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
