Re: write out timestamp
Date: Thu, 24 Sep 2020 16:02:59 -0600
Nice one!
On Thu, Sep 24, 2020 at 3:30 AM Rainer Canavan via curl-users <
curl-users_at_cool.haxx.se> wrote:
> On Thu, Sep 24, 2020 at 6:57 AM Dennis Olvany via curl-users
> <curl-users_at_cool.haxx.se> wrote:
> >
> > It would be super cool if there was a write out for an epoch timestamp.
> For testing, I run thousands of curls in parallel and write out json to a
> log. It would be awesome if there were a timestamp field in the json output.
>
> You could use jq to add that field with any date format you can imagine,
> e.g.
>
> $ curl -w '%{json}' http://www.example.com -o /dev/null | jq ' .
> +{"timestamp":'`date +%s.%N`'}'
>
> $ t=`date --iso-8601`; curl -w '%{json}' http://www.example.com -o
> /dev/null | jq ' . +{"timestamp":"'$t'"}'
>
> rainer
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html
>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-09-25