Outils pour utilisateurs

Outils du site


tech:notes_json

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:notes_json [2026/10/22 18:28] – Jean-Baptistetech:notes_json [2026/11/05 21:01] (Version actuelle) – Jean-Baptiste
Ligne 9: Ligne 9:
 | **jq**        | Command-line JSON processor                                                    | | **jq**        | Command-line JSON processor                                                    |
 | **json_pp**   | JSON Pretty Printer                                                            | | **json_pp**   | JSON Pretty Printer                                                            |
-| **JMESPath**  | JMESPath is a query language for JSON (utilisé par `json_query` d'Ansible    | +| **JMESPath**  | JMESPath is a query language for JSON (utilisé par `json_query` d'Ansible      | 
-| **jp**        | The `jp` command is a command line interface to JMESPath                     |+| **jp**        | The `jp` command is a command line interface to JMESPath                       |
  
  
Ligne 113: Ligne 113:
 Dico vers JSON ? Dico vers JSON ?
 ~~~bash ~~~bash
-cat plop.t | tr \' \" |sed -e 's/None/""/g' | jq .+cat plop.t | tr \' \" | sed -e 's/None/""/g' | jq .
 ~~~ ~~~
  
Ligne 135: Ligne 135:
 Top level sections Top level sections
 ~~~bash ~~~bash
-cat single-instance.json |jq 'keys[]'+cat single-instance.json | jq 'keys[]'
 ~~~ ~~~
 +
 +jq filtrer les clefs contenant des espaces
 +~~~
 +$ cat Historique.json | jq . | head -3
 +{
 +  "Browser History": [
 +    {
 +~~~
 +
 +~~~bash
 +cat Historique.json | jq '."Browser History"' > Historique2.json
 +~~~
 +
 +
  
 Exemple wildcard Exemple wildcard
Ligne 155: Ligne 169:
  
 ~~~bash ~~~bash
-docker inspect portainer/portainer-ce |jq '.[0].RepoTags'+docker inspect portainer/portainer-ce | jq '.[0].RepoTags'
 ~~~ ~~~
  
 ~~~bash ~~~bash
-ansible -i testsrv, -m setup all |sed -e 's/^.*=>//' |jq -r '.ansible_facts.ansible_mounts[] |.mount'+ansible -i testsrv, -m setup all | sed -e 's/^.*=>//' | jq -r '.ansible_facts.ansible_mounts[] |.mount'
 ~~~ ~~~
  
tech/notes_json.1792686520.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki