User Tools

Site Tools


утилита_jq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
утилита_jq [2018/09/14 12:16]
val
утилита_jq [2022/12/20 10:14]
val
Line 2: Line 2:
  
   * [[https://​tproger.ru/​translations/​how-to-parse-json-string-via-command-line/​|Как обрабатывать JSON в командной строке]]   * [[https://​tproger.ru/​translations/​how-to-parse-json-string-via-command-line/​|Как обрабатывать JSON в командной строке]]
 +  * [[https://​www.baeldung.com/​linux/​jq-command-json|Guide to Linux jq Command for JSON Processing]]
 +  * [[https://​stackoverflow.com/​questions/​34226370/​jq-print-key-and-value-for-each-entry-in-an-object|jq:​ print key and value for each entry in an object]]
  
 <​code>​ <​code>​
 # apt install jq # apt install jq
  
-$ zabbix_get -s gate -k vfs.fs.discovery | jq '.data'+$ zabbix_get -s gate -k vfs.fs.discovery | jq 
 + 
 +$ zabbix_get -s gate -k vfs.fs.discovery | jq '.[] | ."​{#​FSTYPE}"​ 
 + 
 +$ zabbix_get -s gate -k vfs.fs.discovery | jq '.[] | select(."​{#​FSTYPE}"​=="​ext4"​)'
 </​code>​ </​code>​
утилита_jq.txt · Last modified: 2022/12/22 10:20 by val