curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: write out timestamp

From: Rainer Canavan via curl-users <curl-users_at_cool.haxx.se>
Date: Thu, 24 Sep 2020 11:21:13 +0200

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
Received on 2020-09-24