Match multi keyword in one line
I am a newest of lnav,How can i match more than one keyword in a log entry,for example my log likes :
[20241212 20:13:14.849761Z ][24858 ][DEBUG ][ChunkStateProcess] recv chunk heartbeat: id=15, version=4, available_│
[20241212 20:13:14.849818Z ][24858 ][INFO ]head {
version: 2
magic_flag: 305400199
session_no: "42190517-560d-4ed8-b8c0-ff216f0fdabb"
source_entity: 337381122
dest_entity: 0
}
body {
[ucloud.udisk.get_lc_chain_request] {
chain_version: 1692631
}
}
how can i match session_no: 42190517-560d-4ed8-b8c0-ff216f0fdabb and chain_version: 1692631 ? i just match one use '/42190517-560d-4ed8-b8c0-ff216f0fdabb'
and how can i custom a log format
I am a newest of lnav,How can i match more than one keyword in a log entry
Are you talking about searching or filtering or ... ?
The search term is treated as a regular expression, so you can use a bar (|) to match one string or another. For example:
/42190517-560d-4ed8-b8c0-ff216f0fdabb|chain_version: 1692631
lnav will then match any line that contains either of those two strings. When you first type / to enter the search prompt, a "Syntax Help" panel should popup with some extra hints and what is possible.