Guest User

Untitled

a guest
Dec 18th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. tail -3f logfile.log | grep "action.*add" | sed -u -e "s/^/'/" -e "s/$/'/" | xargs -L 1 -P 5 bash testscript.sh
  2.  
  3. tail -3f logfile.log | grep "action.*add"
  4.  
  5. tail -3f /var/tmp/rabbitmq-tracing/logfile.log | grep "action.*add" | grep add
  6.  
  7. tail -f file.txt | grep something | grep something | grep something
  8.  
  9. {"twNotif": {"originator": "api", "chain": "test", "txId": "08640-0050568a5514", "version": "1.0", "msgType": "api", "twData": {"api": {"hostId": "007bdcc5", "user": "test", "cmdTxt": "100599"}}, "action": "add", "store": "test", "msgTime": 1467280648.971042}}
  10.  
  11. tail -3f logfile.log | grep --line-buffered "action.*add" | sed -u -e "s/^/'/" -e "s/$/'/" | xargs -L 1 -P 5 bash testscript.sh
  12.  
  13. ... | stdbuf -oL grep ... | ...
  14.  
  15. tail -3f logfile.log | stdbuf -oL grep "action.*add" | sed -u -e "s/^/'/" -e "s/$/'/" | xargs -L 1 -P 5 bash testscript.sh
  16.  
  17. jq -c 'select(.twNotif.action == "add")' file.txt |
  18. xargs -d'n' -r -L 1 -P 5 ./testscript.sh
  19.  
  20. jq 'select(.twNotif.action == "add") | .twNotif.action' file.txt |
  21. sed -e 's/"//g' |
  22. xargs -d'n' -r -L 1 -P 5 ./testscript.sh
  23.  
  24. jsonpipe < file.txt |
  25. awk '$1 == "/twNotif/action" {gsub(/"/,""); print $2}' |
  26. xargs -d'n' -r -L 1 -P 5 ./testscript.sh
  27.  
  28. $ jsonpipe < file.txt
  29. / {}
  30. /twNotif {}
  31. /twNotif/originator "api"
  32. /twNotif/chain "test"
  33. /twNotif/txId "08640-0050568a5514"
  34. /twNotif/version "1.0"
  35. /twNotif/msgType "api"
  36. /twNotif/twData {}
  37. /twNotif/twData/api {}
  38. /twNotif/twData/api/hostId "007bdcc5"
  39. /twNotif/twData/api/user "test"
  40. /twNotif/twData/api/cmdTxt "100599"
  41. /twNotif/action "add"
  42. /twNotif/store "test"
  43. /twNotif/msgTime 1467280648.971042
  44.  
  45. $ jsonpipe <file.txt | awk '{gsub(///,"."); print $1}'
  46. .
  47. .twNotif
  48. .twNotif.originator
  49. .twNotif.chain
  50. .twNotif.txId
  51. .twNotif.version
  52. .twNotif.msgType
  53. .twNotif.twData
  54. .twNotif.twData.api
  55. .twNotif.twData.api.hostId
  56. .twNotif.twData.api.user
  57. .twNotif.twData.api.cmdTxt
  58. .twNotif.action
  59. .twNotif.store
  60. .twNotif.msgTime
Add Comment
Please, Sign In to add comment