使用log_to_data_frame规范化数据

时间:2019-04-02 09:43:41

标签: python pandas dataframe

我正在尝试使用LogToDataFrame形式的bat库将日志文件从bro转换为数据框,但它没有输出,即使文件很小,执行也能保持很长时间

1331901000.000000   CCUIP21wTjqkj8ZqX5  192.168.202.79  50463   192.168.229.251 80  tcp -   -   -   -   SH  -   0   Fa  1   52  1   52  (empty)
1331901000.000000   Csssjd3tX0yOTPDpng  192.168.202.79  46117   192.168.229.254 443 tcp -   -   -   -   SF  -   0   dDafFr  3   382 9   994 (empty)
1331901000.000000   CHEt7z3AzG4gyCNgci  192.168.202.79  50465   192.168.229.251 80  tcp http    0.010000    166 214 SF  -   0   ShADfFa 4   382 3   382 (empty)
1331901000.010000   CKnDAp2ohlvN6rpiXl  192.168.202.79  50467   192.168.229.251 80  tcp http    0.010000    166 214 SF  -   0   ShADfFa 4   382 3   382 (empty)
1331901000.000000   CGUBcoXKxBE8gTNl    192.168.202.79  46119   192.168.229.254 443 tcp ssl 0.020000    544 1060    SF  -   0   ShADadfFr   8   968 13  1744    (empty)
1331901000.020000   CRksHc2i8qahpGOP19  192.168.202.79  46121   192.168.229.254 443 tcp ssl 0.010000    544 1060    SF  -   0   ShADadfFr   8   968 13  1744    (empty)
1331901000.030000   C56nlH3SloWOj44ABi  192.168.202.79  46123   192.168.229.254 443 tcp ssl 0.010000    548 1060    SF  -   0   ShADadfFr   8   972 13  1744    (empty)
1331901000.020000   CNTrjn42F3LB58MZH6  192.168.202.79  50469   192.168.229.251 80  tcp http    0.020000    166 214 SF  -   0   ShADfFa 4   382 3   382 (empty)
1331901000.040000   C1D7mK1PlzKEnEyG03  192.168.202.79  50471   192.168.229.251 80  tcp http    0.010000    166 214 SF  -   0   ShADfFa 4   382 3   382 (empty)
1331901000.050000   CGF1bVMyl9ALKI32l   192.168.202.79  50473   192.168.229.251 80  tcp http    0.010000    164 214 SF  -   0   ShADfFa 4   380 3   382 (empty)
1331901000.040000   CC6D613v9i3xbmQbAf  192.168.202.79  46125   192.168.229.254 443 tcp ssl 0.020000    548 1060    SF  -   0   ShADadfrF   8   972 13  1744    (empty)
1331901000.060000   C5hpJ62EKjvbtDNVr8  192.168.202.79  46127   192.168.229.254 443 tcp ssl 0.010000    544 1060    SF  -   0   ShADadfFr   8   968 13  1744    (empty)
1331901000.060000   CQ7uZu2HtGNngGZl5c  192.168.202.79  50475   192.168.229.251 80  tcp http    0.020000    164 214 SF  -   0   ShADfFa 4   380 3   382 (empty)
1331901000.070000   Cozi0S1MAcO3HMgufa  192.168.202.79  46129   192.168.229.254 443 tcp ssl 0.010000    548 1060    SF  -   0   ShADadfFr   8   972 13  1744    (empty)
1331901000.080000   COdckp4ZoGPteMJ2E4  192.168.202.79  50477   192.168.229.251 80  tcp http    0.010000    164 214 SF  -   0   ShADfFa 4   380 3   382 (empty)
1331901000.090000   CzhIEIizmxUoN6gP7   192.168.202.79  50479   192.168.229.251 80  tcp http    0.010000    166 214 SF  -   0   ShADfFa 4   382 3   382 (empty)
1331901000.090000   C1XmQf3rzo2wvypAMd  192.168.202.79  46131   192.168.229.254 443 tcp ssl 0.010000    548 1060    SF  -   0   ShADadfFr   8   972 13  1744    (empty)

下面您可以找到我的pyhton命令,试图从conn.log文件创建数据框

from bat import log_to_dataframe
import pandas as pd
import numpy as np
conn_df = log_to_dataframe.LogToDataFrame('C:/Users/hmk/Desktop/conn.log')

这是我的笔记本enter image description here

的状态

0 个答案:

没有答案