# gz文件地址
url='https://shilupan-basic-user-pro.oss-cn-shanghai.aliyuncs.com/carrier/moxie/origin/39984791325599432283.txt.gz?Expires=1527497273&OSSAccessKeyId=TMP.AQEh4F-lRNcOsquy3PtvrvhnvooWgj7QI_I5xqpA2V3-yrr0PyQtNKGRWerJADAtAhUAlpsBiOtD6FNQMF9DmtiW3ZO39owCFGME2n4KgLW0ZknE1uQ_rOAPRQoC&Signature=oOn5739IptAlhhh%2F04ckqjQFdTY%3D'
response=requests.get(url)
html=response.text
response.encoding = 'utf-8'
# 解压后为bytes类型
html1 = gzip.decompress(response.content)
print(html)
print(type(html1))
#转化成str
html2=html.decode()
print(type(html2))
# 转为json
html3=json.loads(html2)
print(html3)
print(type(html3))
import requestsimport gzipimport json# gz文件地址url='https://shilupan-basic-user-pro.oss-cn-shanghai.aliyuncs.com/carrier/moxie/origin/39984791325599432283.txt.gz?Expires=1527497273&OSSAccessKey...
Logstash 7.9 的 INPUT 方法中的 File 来源可以指定
gz
ip压缩包读取,但是目前只支持 read 方法(一次把文件从头读到EOF)
input {
file {
path => [ "/d1/log2load/*/*" ]
mode => "read"
file_completed_action => "log"
file_completed_log_path => "/d1/logsta
public static String compress(String primStr) {
if (primStr == null || primStr.length() == 0) {
return primStr;
ByteArrayOutputStream out = new Byte...
#一次性打包整个根目录。空子目录会被打包。
#如果只打包不压缩,将"w:
gz
"参数改为"w:"或"w"即可。
def make_tar
gz
(output_filename, source_dir):
with tarfile.open(output_filename, "w:
gz
") as tar:
tar.add(source_dir, arcname=os.path.basename(source_dir))
#逐个添加文件打包,