Guest User

Untitled

a guest
Jun 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. {
  2. "id": "3885",
  3. "login": "050111",
  4. "lastLoginTime": 1529730115000,
  5. "lastLoginFrom": "192.168.66.230"
  6. }
  7. {
  8. "id": "3898",
  9. "login": "050112",
  10. "lastLoginTime": null,
  11. "lastLoginFrom": null
  12. }
  13.  
  14. $ 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
  15. user: 050111
  16. lastlogintime: 2018-06-23 05:01 UTC
  17. lastloginfrom: 192.168.66.230
  18.  
  19. $ 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
  20. user: 050112
  21. jq: error (at test_json3:12): null (null) and number (1000) cannot be divided
Add Comment
Please, Sign In to add comment