Cisco ASA and logstash problem


I need to process logs from ASA, let's says this:

Oct 2 09:22:41 %ASA-3-202010: NAT pool exhausted. Unable to create UDP connection from inside: to outside:

As I see in grok debugger this is OK:
^%{SYSLOGTIMESTAMP:syslog_timestamp} %{HOSTNAME:device_src} %%{CISCO_REASON:facility}-%{INT:severity_level}-%{CISCO_REASON:facility_mnemonic}: %{GREEDYDATA:syslog_message}

But this config gives me _grokparsefailure
input {
udp {
port => 5515
type => "asa-mts"

filter {
if [type] == "asa-mts" {
# Split the syslog part and Cisco tag out of the message
grok {
match => { "message" => "^%{SYSLOGTIMESTAMP:syslog_timestamp} %{HOSTNAME:device_src} %%{CISCO_REASON:facility}-%{INT:severity_level}-%{CISCO_REASON:facility_mnemonic}: %{GREEDYDATA:syslog_message}" }

Gives me an _grokparsefailure

"_index": "logstash-2018.10.02",
"_type": "doc",
"_id": "y8DXNGYBQAffyVxZr7Xt",
"_version": 1,
"_score": null,
"_source": {
"type": "asa-mts",
"@timestamp": "2018-10-02T12:54:02.359Z",
"host": "",
"syslog_severity_code": 5,
"tags": [
"syslog_facility_code": 1,
"@version": "1",
"syslog_severity": "notice",
"message": "<163>%ASA-3-202010: NAT pool exhausted. Unable to create TCP connection from inside: to outside:\n",
"syslog_facility": "user-level"
"fields": {
"@timestamp": [
"sort": [

Could you tell me what is wrong here?

Thank you!

Use the following on your grok:

^<%{POSINT:syslog_pri}>%%{CISCOTAG:ciscotag}: %{GREEDYDATA:event_type}. Unable to create TCP connection from inside:%{IP:src_ip}/%{INT:src_port} to outside:%{IP:dst_ip}/%{INT:dst_port}$

If you need to test your grok statement. Please use the following site:

or use the Kibana grok plugin

bardie, It is OK on, I mean my expression,
it works in Kibana's Grok Debugger.
But yours does not.

Will try in logstash...

No, still have

"tags": [

Can't understand what is wrong here...

Try this:

<%{POSINT:syslog_pri}>%%{CISCOTAG:ciscotag}: %{GREEDYDATA:event_type}. Unable to create TCP connection from inside:%{IP:src_ip}/%{INT:src_port} to outside:%{IP:dst_ip}/%{INT:dst_port}

If it fails please paste the log you are trying to parse

Thank you!

It works, looks like this was copy&paste problem :frowning:

Anyway, I can't understand why it works in debugger and does not work in logstash.

Yet another example, firepower module:

<46>Oct 5 05:05:33 firepower-mts SFIMS: Protocol: TCP, SrcIP:, OriginalClientIP:, DstIP:, SrcPort: 50084, DstPort: 80, TCPFlags: 0x0, IngressInterface: inside, EgressInterface: outside, IngressZone: inside, EgressZone: outside, DE: Primary Detection Engine (52b0a118-69b8-11e8-b8c9-b6b1432be13e), Policy: Default Allow All Traffic, ConnectType: End, AccessControlRuleName: url filtering, AccessControlRuleAction: Block with reset, Prefilter Policy: Unknown, UserName: No Authentication Required, UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0, Client: Firefox, ClientVersion: 62.0, ApplicationProtocol: HTTP, WebApplication: Squid, InitiatorPackets: 3, ResponderPackets: 1, InitiatorBytes: 694, ResponderBytes: 74, NAPPolicy: Balanced Security and Connectivity, DNSResponseType: No Error, Sinkhole: Unknown, ReferencedHost:, URLCategory: Malware Sites, URLReputation: High risk, URL:

%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:timestamp} %{HOSTNAME:host} %{WORD:blockedReason}: Protocol: %{WORD:protocol}, SrcIP: %{IP:srcIP}, OriginalClientIP: (?[^,]), DstIP: %{IP:dstIP}, SrcPort: %{NUMBER:srcPort}, DstPort: %{NUMBER:dstPort}, TCPFlags: %{WORD:tcpFlags}, IngressInterface: %{WORD:ingressINT}, EgressInterface: %{WORD:egressINT}, IngressZone: %{WORD:ingressZone}, EgressZone: %{WORD:egressZone}, DE: (?[^,]), Policy: (?[^,]), ConnectType: %{WORD:ConnectType}, AccessControlRuleName: (?[^,]), AccessControlRuleAction: (?[^,]), Prefilter Policy: %{WORD:PrefilterPolicy}, UserName: (?[^,]), UserAgent: (?[^,]), Client: (?[^,]), ClientVersion: (?[^,]), ApplicationProtocol: %{WORD:appProtocol}, WebApplication: %{WORD:WebApplication}, InitiatorPackets: %{NUMBER:initPackets}, ResponderPackets: %{NUMBER:respPackets}, InitiatorBytes: %{NUMBER:initBytes}, ResponderBytes: %{NUMBER:respondBytes}, NAPPolicy: (?[^,]), DNSResponseType: (?[^,]), Sinkhole: %{WORD:sinkhole}, ReferencedHost: (?[^,]), URLCategory: (?[^,]), URLReputation: (?[^,]), URL: %{URI:URL}

I get in Kibana Grok Debugger:

"Policy": "Default Allow All Traffic",
"DE": "Primary Detection Engine (52b0a118-69b8-11e8-b8c9-b6b1432be13e)",
"srcIP": "",
"PrefilterPolicy": "Unknown",
"NAPPolicy": "Balanced Security and Connectivity",
"AccessControlRuleAction": "Block with reset",
"respondBytes": "74",
"appProtocol": "HTTP",
"srcPort": "50084",
"respPackets": "1",
"ClientVersion": "62.0",
"sinkhole": "Unknown",
"URLCategory": "Malware Sites",
"URL": "",
"ConnectType": "End",
"protocol": "TCP",
"dstPort": "80",
"host": "firepower-mts",
"UserAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0",
"ReferencedHost": "",
"dstIP": "",
"tcpFlags": "0x0",
"egressZone": "outside",
"Client": "Firefox",
"WebApplication": "Squid",
"syslog_pri": "46",
"timestamp": "Oct 5 05:05:33",
"UserName": "No Authentication Required",
"blockedReason": "SFIMS",
"URLReputation": "High risk",
"initPackets": "3",
"DNSResponseType": "No Error",
"ingressINT": "inside",
"initBytes": "694",
"egressINT": "outside",
"ingressZone": "inside",
"AccessControlRuleName": "url filtering",
"OriginalClientIP": ""

But "tags": [
in logstash.

Could you, please, tell me how can I find error if debugger shows everything is fine?

Thank you!

For Grok, the only way to debug is by testing the grok statement on the grok debugger app or plugin. Other than that just make sure your filter format has no errors

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