Skip to content

Commit 078b531

Browse files
committed
Improve Humio imports.
1 parent de2e5fb commit 078b531

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
v0.3.15 Improved Humio import.
12
v0.3.14 Removed a print statement.
23
v0.3.13 Fixed some errors on Humio import.
34
v0.3.12 Will continue to populate data after a Humio error.

Readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ logs into [ElasticSearch's bulk load JSON format](https://www.elastic.co/guide/e
1717
- [Command Line Options](#commandlineoptions)
1818
- [Requirements](#requirements)
1919
- [Notes](#notes)
20+
- [Humio](#humio)
2021
- [JSON Log Input](#jsonloginput)
2122
- [Data Streams](#datastreams)
2223
- [Helper Scripts](#helperscripts)
@@ -318,6 +319,18 @@ You will need to add -k -u elastic_user:password if you are using Elastic v8+.
318319

319320
## Notes <a name="notes" />
320321

322+
### Humio <a name="humio" />
323+
324+
To import your data into Humio you will need to set up a repository with the `corelight-json` parser. Obtain
325+
the ingest token for the repository and you can import your data with a command such as:
326+
327+
```
328+
python3 zeek2es.py -s -b --humio http://localhost:8080 b005bf74-1ed3-4871-904f-9460a4687202 http.log
329+
```
330+
331+
The URL should be in the format of: `http://yourserver:8080`, as the rest of the path is added by the
332+
`zeek2es.py` script automatically for you.
333+
321334
### JSON Log Input <a name="jsonloginput" />
322335

323336
Since Zeek JSON logs do not have type information like the ASCII TSV versions, only limited type information

zeek2es.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,14 @@ def main(**args):
445445
# Prepare the output and increment counters
446446
if args['humio']:
447447
d['ts'] = d['ts'] + "Z"
448-
d["_write_ts"] = d["ts"]
448+
if "_write_ts" in d:
449+
d['_write_ts'] = d['_write_ts'] + "Z"
450+
else:
451+
d["_write_ts"] = d["ts"]
452+
if "_path" not in d:
453+
d["_path"] = zeek_log_path
454+
if (len(args['name'].strip()) > 0):
455+
d["_system_name"] = args['name'].strip()
449456
d["@timestamp"] = d["ts"]
450457
outstring += json.dumps(d)+"\n"
451458
n += 1

0 commit comments

Comments
 (0)