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 <>
Date: Thu, 24 Sep 2020 11:21:13 +0200

On Thu, Sep 24, 2020 at 6:57 AM Dennis Olvany via curl-users
<> 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}' -o /dev/null | jq ' .
+{"timestamp":'`date +%s.%N`'}'

$ t=`date --iso-8601`; curl -w '%{json}' -o
/dev/null | jq ' . +{"timestamp":"'$t'"}'

Received on 2020-09-24