面向蜥蜴人的python cef解析

pourover的Python项目详细描述


https://img.shields.io/badge/license-Apache%202.0-blue.svghttps://img.shields.io/badge/python-3.6,%203.7-blue.svghttps://img.shields.io/badge/pypi-v0.1--beta8-green.svghttps://circleci.com/gh/zthart/pourover/tree/develop.svg?style=svg

pourov是唯一的chemicaly-alteredCEF日志解析库 Python,非常适合蜥蜴类动物食用。

the requests guy does it so maybe it'll work for me

我们可以做一些事情:

fromdatetimeimportdatetimeimportpourover# Create log objects from a filelog=pourover.parse_file('test.log')# check the length pythonically - expose useful propertiesiflen(log)>10:iflog.has_syslog_prefixandlog.start_time>datetime(year=2018,month=4,day=20):# perform some operationspasselse:# perform some operations on a logfile that doesn't have syslog prefixespasselse:# perform some operations on a really small logpass# Find messages with a certain value in the headersearch_results=log.search_headers('Specific Vendor')formessageinlog:# iterate through each message in the log like you'd expect to be able topass# Logs can be indexed/sliced in the way you'd expectfirst_message=log[0]last_message=log[-1]# Create message objects from a stringmessage=pourover.parse_line('Apr 15 22:11:20 testhost CEF:0|Test Vendor|Test Product|Test Version|100|Test Name|100|src=1.1.1.1 dst=1.1.1.2')ifmessage.has_syslog_prefix:ifmessage.timestamp>datetime(year=2018,month=4,day=20):# perform an operation on logs from later than April 20th, 2018passif'src'inmessage.extensions:# do something if it's got an extension called 'src'passifmessage.device_vendor=='Some Vendor':# do something if the vendor is Some Vendorpass# stick this message right onto that log (it'll even order the messages by timestamp - wow!)log.append(message)

安装:计算机:

要安装Pourov,只需运行

$ pip install pourover
✨?✨

特点:鳄鱼:

-:dragon面:从支持扩展和syslog前缀的参数创建cef格式的日志行
-:dragon面:从字符串创建有用的行对象,或从文件创建整个日志对象
-:dragon_face:Iterable log objects可同时操作日志集合
-:dragon面:轻松解析带或不带syslog前缀的行扩展
-:dragon面部:搜索具有特定标题或扩展名的邮件的日志
-:龙脸:及更多…

撰稿人:龙:

:错误:Bugs:
请创建任何您认为我应该检查的问题!如果有 你发现的错误或你认为正在起作用的函数,请告诉我。 这个项目最终会有测试,但在此之前我确信 会时不时冒出问题!
:闪烁:new features/prs:
该项目仍处于初期阶段,因此prs可能会遇到困难 当代码基处于不断变化的状态时合并进来, 但我很乐意和你讨论一个新的 你想看的特写!

联系:snake:

如果你发现了一个bug或者想提出一个功能请求,请 请参阅上面的贡献部分,谢谢!

如果你想联系我,给我发一封邮件到zach@csh.rit.edu

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在没有代码气味的情况下编写遵循Liskov替代和其他可靠原则的不可变映射?   java最新jre上的压缩字符串对旧编译代码有好处吗?   java是否可以在javascript中取消PrimeFaces menuitem onclick函数   mysql从SQL数据库中访问java中xml名称空间标记的值   从java程序打开excel文件   java在方法中使用“var”是否会使执行(并发)线程不安全?   java使搜索视图以一种关于AndroidManifest的通用方式可用。xml   java对如何准确使用正则表达式感到困惑?   mule如何访问java文件中的记录变量   java在从2D数组引发异常后继续   枚举当前设置为的java值   java当listview只有几个项目时,如何使alert对话框显示listview的所有项目?   java getTableRow()返回大于项大小的索引   c用java传输二进制文件(数据)   java更改多选列表项复选框颜色