# Help parse Snort IDS Alert

**URL:** <https://discuss.elastic.co/t/help-parse-snort-ids-alert/256991>\
**Category:** Logstash\
**Created:** [November 29, 2020, 3:45pm UTC](https://discuss.elastic.co/t/help-parse-snort-ids-alert/256991 "2020-11-29T15:45:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolkaveh](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@coolkaveh](https://discuss.elastic.co/u/coolkaveh)\
**Post date:** [November 29, 2020, 3:45pm UTC](https://discuss.elastic.co/t/help-parse-snort-ids-alert/256991/1 "2020-11-29T15:45:51Z")

</div>

Please help me to correct my Logstash conf as below:  
Log:

```
11/28-06:50:39.263833 [**] [1:31978:5] OS-OTHER Bash CGI environment variable injection attempt [**] [Classification: Attempted Administrator Privilege Gain] [Priority: 1] {TCP} 10.120.41.183:44224 -> 10.120.69.42:80

```

Conf:

input {  
file {  
path =\> "/var/log/snort/enp175s0f0/alert"  
start\_position =\> "beginning"  
}  
}

filter {  
if [path] =~ "access" {

```
grok {
    match => {"message"=> [' %{MONTHNUM:month}\/%{MONTHDAY:day}-%{HOUR:hour}:%{MINUTE:minute}:%{DATA:ids_proto}
   \s+\[\*\*]\s+\[Classification:\s+%{DATA:ids_classification}\]\s+\[Priority:\s+%{INT:priority}\]\s+\{%{WORD:protocol}\}
   \s+%{IP:src_ip}\:%{INT:src_port}\s+\-\>\s+%{IP:dst_ip}\:%{INT:dst_port}'] }

```

}  
}

date {  
match =\> ["timestamp" , "dd/MMM/yyyy:HH:mm:ss Z"]  
}  
}

output  
{  
elasticsearch  
{  
hosts =\> ["localhost:9200"]  
manage\_template =\> true  
index =\> "snortids-%{+YYYY.MM.dd}"  
template\_name =\> "snorids"  
}  
stdout{  
codec =\> rubydebug  
}  
}

Output:

```
 "path" => "/var/log/snort/enp175s0f0/alert",
  "@version" => "1",
   "message" => "11/28-06:50:39.263833 [**] [1:31978:5] OS-OTHER Bash CGI environment variable injection attempt [**] [Classification: Attempted Administrator Privilege Gain] [Priority: 1] {TCP} 10.120.41.183:44224 -> 10.120.69.42:80",
"@timestamp" => 2020-11-28T12:01:41.624Z,
      "host" => "ids01.atlis1"

```

 ![groke](https://us1.discourse-cdn.com/elastic/original/3X/5/2/52be0603f631f559bd84568165c3cc0b5c43d575.jpeg)

What I am missing ? My grok is correct and tested with debugger and the out put works fine but in logstash output still is online and is not filtering anything. based on my groke.  
Any help would be much apricated.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 29, 2020, 7:33pm UTC](https://discuss.elastic.co/t/help-parse-snort-ids-alert/256991/2 "2020-11-29T19:33:15Z")

</div>

My answer [here](https://discuss.elastic.co/t/grokparse-failure-and-after-successful-debug/254324/2) applies to this.

---

<div class="post-metadata">

**Author:** ![coolkaveh](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@coolkaveh](https://discuss.elastic.co/u/coolkaveh)\
**Post date:** [November 30, 2020, 1:30pm UTC](https://discuss.elastic.co/t/help-parse-snort-ids-alert/256991/3 "2020-11-30T13:30:27Z")

</div>

Thank you.

---

<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:** [December 28, 2020, 1:30pm UTC](https://discuss.elastic.co/t/help-parse-snort-ids-alert/256991/4 "2020-12-28T13:30:44Z")

</div>

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