Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match multi keyword in one line #1357

Open
jary-287 opened this issue Dec 14, 2024 · 1 comment
Open

Match multi keyword in one line #1357

jary-287 opened this issue Dec 14, 2024 · 1 comment

Comments

@jary-287
Copy link

jary-287 commented Dec 14, 2024

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

@tstack
Copy link
Owner

tstack commented Dec 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants