摘要: import java.security.cert.CertificateException;import java.security.cert.X509Certificate;import java.util.ArrayList;import java.util.Iterator;import java.util.List;import java.util.Map;import java.uti... 阅读全文
posted @ 2019-06-21 10:49 remainsu 阅读(2075) 评论(0) 推荐(0)
摘要: import javax.servlet.http.HttpServletRequest;import java.net.InetAddress;import java.net.UnknownHostException; /** * 获取访问接口的客户端的ip地址 * @author remainsu * @version 1.0 2019-05-11 * * 使用说明: * 1. Cont... 阅读全文
posted @ 2019-06-21 10:48 remainsu 阅读(1345) 评论(0) 推荐(0)
摘要: import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.io.PrintWriter;import java.net.URL;import java.net.URLConnection;import java.util.List;import java... 阅读全文
posted @ 2019-06-21 10:47 remainsu 阅读(348) 评论(0) 推荐(0)
摘要: #!/usr/bin/env python#coding=utf8'''用于多机器间相互跳转,如有新机器加入,需要更新ip_list文件'''from prettytable import PrettyTablefrom sh import catimport osimport reclass GO(): def __init__(self): self.base_path =... 阅读全文
posted @ 2019-06-21 10:08 remainsu 阅读(490) 评论(0) 推荐(0)
摘要: .tar 解包 tar xvf filename.tar.tar 打包 tar cvf filename.tar dirname.gz 解压1 gunzip filename.gz.gz 解压2 gzip -d filename.gz.gz 压缩 gzip filename.tar.gz 和 .tgz 解压 tar zxvf filename.tar.gz.tar.gz 和 .tgz 压缩 tar... 阅读全文
posted @ 2019-06-21 10:07 remainsu 阅读(1261) 评论(0) 推荐(0)
摘要: #!/bin/bashstart_date="2017-10-26"for i in `seq 0 30`do num=$((${i}+1)) datatime=`date '+%Y-%m-%d' -d ${start_date}'+'${num}' day'` echo ${datatime}done 阅读全文
posted @ 2019-06-21 10:06 remainsu 阅读(440) 评论(0) 推荐(0)
摘要: 1. 建立连接from elasticsearch import Elasticsearches = Elasticsearch(["localhost:9200"])2. 查询所有数据# 方式1:es.search(index="index_name", doc_type="type_name") # 方式2:body = { "query":{ "match_all":{}... 阅读全文
posted @ 2019-06-20 23:25 remainsu 阅读(20565) 评论(1) 推荐(1)
摘要: 使用python连接es并执行最基本的查询from elasticsearch import Elasticsearches = Elasticsearch(["localhost:9200"])para = {"_source":"message"}es.search(index=index_name, q='offset: xx', doc_type='doc' ,params=para, s... 阅读全文
posted @ 2019-06-20 23:24 remainsu 阅读(881) 评论(2) 推荐(0)
摘要: import datetimeimport sysimport getoptimport hashlibfrom elasticsearch import Elasticsearch"""初始化elasticsearch连接"""def init_es(): return Elasticsearch(["localhost:9200"])"""查询数据, 支持分页"""def query_d... 阅读全文
posted @ 2019-06-20 23:24 remainsu 阅读(238) 评论(0) 推荐(0)
摘要: 这里使用filebeat直连elasticsearch的形式完成数据传输,由于没有logstash,所有对于原始数据的过滤略显尴尬(logstash的filter非常强大)。 但是由于业务需求,还是需要将message(原始数据)中的某些字段进行提取,具体方式如下:1. /path/目录下建立pipeline.json文件{ "description" : "test-pipeline", "... 阅读全文
posted @ 2019-06-20 23:19 remainsu 阅读(988) 评论(0) 推荐(0)