On Thu, Aug 26, 2021 at 04:29:27PM -0400, Viktor Dukhovni wrote:

> You can start with something like:
> 
>     $ postqueue -j |
>         jq --argjson now "$(date +%s)" '
>             ($now - .arrival_time) as $delay |
>             select (.queue_name == "deferred" and $delay > 300) |
>             .delay = $delay
>             '

I neglected to check whether "jq" had a built-in "now" function.  Given
the answer is "yes", this could be rewritten as:

    $ postqueue -j |
        jq -n 'now as $now |
               inputs |
               ($now - .arrival_time) as $delay |
               select (.queue_name == "deferred" and $delay > 300) |
               .delay = $delay
           '

-- 
    Viktor.

Reply via email to