base/protocols/mqtt/main.zeek
- MQTT
Implements base functionality for MQTT (v3.1.1) analysis. Generates the mqtt.log file.
- Namespace:
MQTT
- Imports:
Summary
Redefinable Options
Well-known ports for MQTT. |
Types
Data structure to track pub/sub messaging state of a given connection. |
|
Redefinitions
|
Events
Event that can be handled to access the MQTT record as it is sent on to the logging framework. |
Hooks
Functions
The expiration function for published messages that haven’t been logged yet simply causes the message to be logged. |
|
The expiration function for subscription messages that haven’t been logged yet simply causes the message to be logged. |
Detailed Interface
Redefinable Options
- MQTT::ports
-
Well-known ports for MQTT.
Types
- MQTT::ConnectInfo
- MQTT::PublishInfo
- Type:
- Fields:
-
-
from_client:
bool&log Indicates if the message was published by the client of this connection or published to the client.
-
status:
string&log&default="incomplete_qos"&optional Status of the published message. This will be set to “incomplete_qos” if the full back and forth for the requested level of QoS was not seen. Otherwise if it’s successful the field will be “ok”.
-
payload_len:
count&log The actual length of the payload in the case the payload field’s contents were truncated according to
MQTT::max_payload_size.
-
from_client:
- MQTT::State
- Type:
- Fields:
-
publish:
table[count] ofMQTT::PublishInfo&optional&write_expire=5.0 secs&expire_func=MQTT::publish_expire Published messages that haven’t been logged yet.
-
subscribe:
table[count] ofMQTT::SubscribeInfo&optional&write_expire=5.0 secs&expire_func=MQTT::subscribe_expire Subscription/unsubscription messages that haven’t been ACK’d or logged yet.
-
publish:
Data structure to track pub/sub messaging state of a given connection.
- MQTT::SubscribeInfo
- Type:
- Fields:
-
-
action:
MQTT::SubUnsub&log Indicates if a subscribe or unsubscribe action is taking place
-
topics:
string_vec&log The topics (or topic patterns) being subscribed to
-
action:
Events
- MQTT::log_mqtt
- Type:
event(rec:MQTT::ConnectInfo)
Event that can be handled to access the MQTT record as it is sent on to the logging framework.
Hooks
Functions
- MQTT::publish_expire
-
The expiration function for published messages that haven’t been logged yet simply causes the message to be logged.
- MQTT::subscribe_expire
-
The expiration function for subscription messages that haven’t been logged yet simply causes the message to be logged.