filter print output

I am trying to print the log where topics=system. I have tried searching the forums, wiki and docs for how to filter the print output. A couple examples.

/log print where topics=“system” doesn’t work
I am trying to print the log with a certain topic
I am trying to print the log with a certain text
I am trying to print connections with p2p not equal to none.

If you can point me in the right direction, I would appreciate it.

Thank you,

Cory

/log print where topics=“system” won’t work because topic is not always one word
For example to print following log line
04:17:51 system,info log rule changed by admin

you have to write
/log print where topics=“system,info”

I understand that. How do I filter n just the one word instead of trying to print all of the permutations with system?

system, info
system, error, critical
system, info, account

And it’s not really just for system. It’s for all. How do I print all of the critical messages in the log? How do I print all of the messages except ones having to do with dhcp?

Thank you

Cory

If scripts are not out of the question:

:local loglist [/log find]
:local topics
:local thistopic "critical"

:foreach i in=$loglist do={
    :set topics [/log get $i topics]
    :if ([:len [:find $topics $thistopic]] > 0) do={
:put ([/log get $i time] . " " . [:tostr [/log get $i topics]] . " " . [/log get $i message])
    }
}

Only log entries that contain critical will be printed. Run only in a shell, or replace “:put” with another command.

Thank you SurferTim.

Seriously, there is no documentation on where, topics, or include?

Can we get some. I’d be happy to write some, but I can’t figure it out.

Thanks,

Cory