面向蜥蜴人的python cef解析
pourover的Python项目详细描述
pourov是唯一的chemicaly-alteredCEF日志解析库 Python,非常适合蜥蜴类动物食用。
我们可以做一些事情:
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可能会遇到困难
当代码基处于不断变化的状态时合并进来,
但我很乐意和你讨论一个新的
你想看的特写!推荐PyPI第三方库
- 热门话题
- Java例外。Lang.Stringindexoutofboundsexception索引超出范围(0) java Spring引导Freemarker从2.2.0升级失败 重构Java反模式名称?包含对象的对象包含。。。等 用java处理JDBC可能出现的死锁的最佳方法 java无法访问主线程上的数据库,因为它可能会在很长一段时间内锁定UI java如何将固定大小的画布包装在边框窗格中的滚动窗格居中? java解析xsd文件后得到空结果 在html页面中表示XML文件的java socketjava对象流 sql Java越界异常数据库 JavaJBoss7.1.1不会在Mavericks上启动 Twincat ADS事件驱动读取在一段时间后停止工作(Java) java MyBatis使用生成的ID插入所有 Mojave上缺少MacOS Java控制面板 JavaGuice:如果多次注入相同的依赖项,是否注入了该依赖项的相同实例?