Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "id": "3885",
- "login": "050111",
- "lastLoginTime": 1529730115000,
- "lastLoginFrom": "192.168.66.230"
- }
- {
- "id": "3898",
- "login": "050112",
- "lastLoginTime": null,
- "lastLoginFrom": null
- }
- $ jq -jr --arg ARG1 050111 'select(.login==$ARG1)|"user:", " ",.login,"n","lastlogintime:", " ",(.lastLoginTime / 1000 | strftime("%Y-%m-%d %H:%M UTC")),"n","lastloginfrom:", " ",.lastLoginFrom // "-","n"' test_json3
- user: 050111
- lastlogintime: 2018-06-23 05:01 UTC
- lastloginfrom: 192.168.66.230
- $ jq -jr --arg ARG1 050112 'select(.login==$ARG1)|"user:", " ",.login,"n","lastlogintime:", " ",(.lastLoginTime / 1000 | strftime("%Y-%m-%d %H:%M UTC")),"n","lastloginfrom:", " ",.lastLoginFrom // "-","n"' test_json3
- user: 050112
- jq: error (at test_json3:12): null (null) and number (1000) cannot be divided
Add Comment
Please, Sign In to add comment