将日志中的json请求提取,并且发送到另外一个机器上: for i in ` cat impression.log.2016-04-08-10 |awk -F"\t" ' {print $6}' ` ; do curl "http://localhost:9888$i" ; done 使用cat 文件,read line 的形式实现 遍历行循环发送: #!/bin/bash cat data.txt | while read line do # echo $line
一.Httpclient发送json请求 public String RequestJsonPost(String url){ String strresponse = null; try{ HttpClient hc = new DefaultHttpClient(); HttpPost hp = new HttpPost(url); JSONObject jsonParam = new JSONObject(); jsonPara