Skip to content

Instantly share code, notes, and snippets.

@knudmoeller
Created December 21, 2021 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knudmoeller/d17079d1f11b37a41713f8f134e6910b to your computer and use it in GitHub Desktop.
Save knudmoeller/d17079d1f11b37a41713f8f134e6910b to your computer and use it in GitHub Desktop.
  • Input data are multiple json files in sorted/ with this minimal structure:
{
  "dump_finished": "2021-12-14T10:43:42+01:00",
  "datasets": [
    ...
  ]
}
  • Query all *.json files in sorted, slurp all results into a large array:
jq "{date: .dump_finished, count: .datasets | length}" sorted/*.json | jq -s
  • Output is something like:
[
  {
    "date": "2014-11-04",
    "count": 765
  },
  {
    "date": "2015-06-19",
    "count": 804
  },
  ...
  {
    "date": "2021-12-14T10:43:42+01:00",
    "count": 2867
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment