Spaces:
Running
Running
Commit ·
c8aa6e6
1
Parent(s): 24f4026
datetime instead of date
Browse files- sections/upload.py +6 -4
sections/upload.py
CHANGED
|
@@ -9,7 +9,9 @@ from utils.pandas2sql import Pandas2SQL
|
|
| 9 |
|
| 10 |
st.title("ShadowLog - Log File Analyzer")
|
| 11 |
st.write("Upload a log file to analyze with the following format :")
|
| 12 |
-
st.write(
|
|
|
|
|
|
|
| 13 |
|
| 14 |
uploaded_file = st.file_uploader("Choose a log file")
|
| 15 |
|
|
@@ -26,7 +28,7 @@ if uploaded_file is not None:
|
|
| 26 |
has_header=False,
|
| 27 |
infer_schema_length=10000,
|
| 28 |
dtypes={
|
| 29 |
-
"
|
| 30 |
"ipsrc": pl.Utf8,
|
| 31 |
"ipdst": pl.Utf8,
|
| 32 |
"protocole": pl.Utf8,
|
|
@@ -40,8 +42,8 @@ if uploaded_file is not None:
|
|
| 40 |
},
|
| 41 |
)
|
| 42 |
.filter(
|
| 43 |
-
(pl.col("
|
| 44 |
-
& (pl.col("
|
| 45 |
)
|
| 46 |
.drop(["portsrc", "unknown", "fw"])
|
| 47 |
)
|
|
|
|
| 9 |
|
| 10 |
st.title("ShadowLog - Log File Analyzer")
|
| 11 |
st.write("Upload a log file to analyze with the following format :")
|
| 12 |
+
st.write(
|
| 13 |
+
"datetime;ipsrc;ipdst;protocole;portsrc;portdst;rule;action;interface;unknown;fw"
|
| 14 |
+
)
|
| 15 |
|
| 16 |
uploaded_file = st.file_uploader("Choose a log file")
|
| 17 |
|
|
|
|
| 28 |
has_header=False,
|
| 29 |
infer_schema_length=10000,
|
| 30 |
dtypes={
|
| 31 |
+
"datetime": pl.Datetime,
|
| 32 |
"ipsrc": pl.Utf8,
|
| 33 |
"ipdst": pl.Utf8,
|
| 34 |
"protocole": pl.Utf8,
|
|
|
|
| 42 |
},
|
| 43 |
)
|
| 44 |
.filter(
|
| 45 |
+
(pl.col("datetime") >= pl.datetime(2024, 11, 1))
|
| 46 |
+
& (pl.col("datetime") < pl.datetime(2025, 3, 1))
|
| 47 |
)
|
| 48 |
.drop(["portsrc", "unknown", "fw"])
|
| 49 |
)
|