Shared events work across all connection types. They are located inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nokia/moler/llms.txt
Use this file to discover all available pages before exploring further.
moler.events.shared and do not depend on Unix-specific output formats.
Event list
| Class | Module | What it detects |
|---|---|---|
Wait4 | moler.events.shared.wait4 | Any pattern(s) in connection output |
PasswordPrompt | moler.events.shared.password_prompt | Case-insensitive password: prompt |
GenericSharedLineEvent | moler.events.shared.genericshared_lineevent | (abstract base — line-based) |
GenericSharedTextualEvent | moler.events.shared.genericshared_textualevent | (abstract base — textual) |
Detailed reference
Wait4 — moler.events.shared.wait4
The universal event observer. Watches a connection for one or more regex patterns and fires when the configured match condition is met. Wait4prompt (in moler.events.unix) is built on top of this class.
Moler connection to observe.
List of regex patterns to watch for.
Match strategy. Options:
"any"— fire when any pattern matches a line (default)"all"— fire once all patterns have each matched (order-independent)"sequence"— fire once all patterns have matched in order across consecutive lines
Number of match events to collect before completing. Default
-1 (run indefinitely).Runner used to execute the event.
result depends on the match strategy:
-
"any"—resultis a flat list of occurrence dicts, one per matching line:Key Type Description linestrFull line that matched matchedstrSubstring matched by the pattern groupstupleUnnamed capture groups named_groupsdictNamed capture groups timedatetimeTimestamp of the match -
"all"/"sequence"—resultis a list of match-sets. Each match-set is itself a list containing one occurrence dict per pattern, in the order the patterns were satisfied.
Match modes explained
| Mode | Behaviour | Result shape |
|---|---|---|
any | Each line is checked against all patterns independently; fires on every individual match | [{match_dict}, ...] |
all | Collects matches for each pattern; fires once every pattern has been seen (in any order) | [[{p0_dict}, {p1_dict}], ...] |
sequence | Like all, but pattern[N+1] is only considered after pattern[N] has already matched | [[{p0_dict}, {p1_dict}], ...] |
For
match='sequence', if pattern[0] matches but pattern[1] never follows, the event will not fire (unless till_occurs_times would be satisfied by a later re-match of pattern[0] followed by pattern[1]).PasswordPrompt — moler.events.shared.password_prompt
Fires whenever a case-insensitive password: prompt appears on the connection. Useful for detecting interactive credential requests during login flows on any device type.
Moler connection to observe.
Number of occurrences to collect. Default
-1.r'password:' (case-insensitive)
Result list item keys
| Key | Type | Description |
|---|---|---|
time | datetime | Timestamp when the prompt was detected |
line | str | The line containing password: |
Base classes
GenericSharedLineEvent — moler.events.shared.genericshared_lineevent
Base for events that match on complete lines using a list of detect_patterns. Subclass this when you need a simple line-pattern event that works on any connection type.
GenericSharedTextualEvent — moler.events.shared.genericshared_textualevent
Base for events that require custom on_new_line() parsing logic rather than simple pattern lists. Subclass this when the event needs to aggregate data across multiple lines (like LastLogin).