[root@xbackup3 ~/job]# yum search jq
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
base | 3.7 kB 00:00
Not using downloaded repomd.xml because it is older than what we have:
Current : Wed Nov 7 18:48:21 2018
Downloaded: Sat Jun 30 00:37:23 2018
epel | 3.0 kB 00:00
extras | 3.4 kB 00:00
storage | 2.9 kB 00:00
updates | 3.4 kB 00:00
============================================================================================================================== N/S Matched: jq ===============================================================================================================================
drupal7-jquery_update.noarch : Upgrades the version of jQuery in Drupal core to a newer version of jQuery
jq-debuginfo.x86_64 : Debug information for package jq
python-tw-jquery.noarch : ToscaWidgets wrapping for jQuery
python-tw2-jqplugins-flot.noarch : jQuery flot (plotting) for ToscaWidgets2
python-tw2-jqplugins-gritter.noarch : jQuery gritter (growl-like pop-ups) for ToscaWidgets2
python-tw2-jqplugins-jqplot.noarch : Toscawidgets2 wrapper for the jqPlot jQuery plugin
python-tw2-jqplugins-ui.noarch : jQuery UI for ToscaWidgets2
python-tw2-jquery.noarch : jQuery for ToscaWidgets2
jq.x86_64 : Command-line JSON processor
python-pyquery.noarch : A jQuery-like library for python
python-turboflot.noarch : A TurboGears widget for Flot, a jQuery plotting library
Name and summary matches only, use "search all" for everything.
bash 에서 JSON 으로 데이터를 받아 올 때,
아래와 같이 출력되어 bash에서 가공이 힘들었음
jq 명령어를 사용하니 아래와 같이 깔끔하게 나온다
또 원하는 부분만 출력이 가능하다!
[root@xbackup3 ~/job]# curl -s -X POST -H 'Content-Type: application/json' -d '{
"jsonrpc": "2.0",
"method": "item.get",
"params": {
"output": "extend",
"hostids": "14342",
"search": {
"key_": "sapevdc"
},
"sortfield": "name"
},
"auth": "ㅇㅇㅇd",
"id": 1
}' http://ㅇㅇㅇㅇ/zabbix/api_jsonrpc.php | jq '.result[] | {username,error}'
{
"error": "",
"username": ""
}
{
"error": "",
"username": ""
}
{
"error": "",
"username": ""
}
centos7 vsftpd 계정 로그인 이슈 (0) | 2020.11.06 |
---|---|
리눅스 last 접속 로그 수정하기 (0) | 2019.09.02 |
리눅스 sssd 캐시 클리어 (0) | 2019.01.23 |
텔레그램 CLI (0) | 2016.03.25 |
xfs 타입, xfs type inode No space left on device 에러 (0) | 2016.01.11 |