# SIEM Zeek log data getting Error decoding JSON

**URL:** <https://discuss.elastic.co/t/siem-zeek-log-data-getting-error-decoding-json/191103>\
**Category:** SIEM\
**Created:** [July 17, 2019, 10:40pm UTC](https://discuss.elastic.co/t/siem-zeek-log-data-getting-error-decoding-json/191103 "2019-07-17T22:40:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpangallo](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@dpangallo](https://discuss.elastic.co/u/dpangallo)\
**Post date:** [July 17, 2019, 10:40pm UTC](https://discuss.elastic.co/t/siem-zeek-log-data-getting-error-decoding-json/191103/1 "2019-07-17T22:40:42Z")

</div>

I'm trying to ingest Zeek network log data (formerly Bro) into SIEM (Beta 7.2). Finally got it configured to ingest the data but I'm getting tons of errors decoding JSON. Here's a sample:  
ERROR#011readjson/json.go:52#011Error decoding JSON: json: cannot unmarshal number into Go value of type map[string]interface {}  
AND  
Error decoding JSON: json: cannot unmarshal number into Go value of type map[string]interface {}  
I'm using filebeat to ingest directly into elasticsearch. Here's my filebeat.yml:

#============================== Kibana =====================================  
setup.kibana:  
host: "mykibana host info here"  
#-------------------------- Elasticsearch output ------------------------------  
output.elasticsearch:

# Array of hosts to connect to.

hosts: "my elasticsearch host info here"

#============================= Filebeat modules ===============================

filebeat.config.modules:

# Glob pattern for configuration loading

path: ${path.config}/modules.d/\*.yml

Here is my Zeek.yml:

- module: zeek
# All logs
connection:  
enabled: true  
var.paths:  
- "/usr/local/bro/spool/logger/conn.log"  
dns:  
enabled: true  
var.paths:  
- "/usr/local/bro/spool/logger/dns.log"  
http:  
enabled: true  
var.paths:  
- "/usr/local/bro/spool/logger/http.log"  
files:  
enabled: true  
var.paths:  
- "/usr/local/bro/spool/logger/files.log"  
ssl:  
enabled: true  
var.paths:  
- "/usr/local/bro/spool/logger/ssl.log"  
notice:  
enabled: true  
var.paths:  
- "/usr/local/bro/spool/logger/notice.log"

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [July 18, 2019, 11:48am UTC](https://discuss.elastic.co/t/siem-zeek-log-data-getting-error-decoding-json/191103/2 "2019-07-18T11:48:00Z")

</div>

Is your Zeek configured to output logs in JSON format? Because it seems that the default is plain-text logs, and SIEM requires the logs in JSON.

According to the Zeek docs:

> Some writer options are global (i.e., they affect all log filters using that log writer). For example, to change the output format of all ASCII logs to JSON format:
> 
> redef LogAscii::use\_json = T;

---

<div class="post-metadata">

**Author:** ![dpangallo](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@dpangallo](https://discuss.elastic.co/u/dpangallo)\
**Post date:** [July 18, 2019, 5:23pm UTC](https://discuss.elastic.co/t/siem-zeek-log-data-getting-error-decoding-json/191103/3 "2019-07-18T17:23:09Z")

</div>

Adrian, Thanks.  
I found and applied this bro (zeek) script to change logs to JSON format and ISO date format:  
(this assumes compiled (bin) Bro install directory structure, ie /opt/bro. So you may need to adjust for your install if source install; /usr/local/bro)

> <https://gist.github.com/dcode/97039239c74a1c1e420c>

## Configure bro to write JSON logs

mkdir -p /opt/bro/share/bro/site/scripts

sudo tee /opt/bro/share/bro/site/scripts/json-logs.bro \<\< EOF

@load tuning/json-logs

redef LogAscii::json\_timestamps = JSON::TS\_ISO8601;

redef LogAscii::use\_json = T;

EOF

sudo tee -a /opt/bro/share/bro/site/local.bro \<\< EOF

# Load policy for JSON output

@load scripts/json-logs

EOF

---

<div class="post-metadata">

**Author:** ![adrisr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adrisr/32/25423_2.png) [@adrisr](https://discuss.elastic.co/u/adrisr)\
**Post date:** [July 18, 2019, 7:13pm UTC](https://discuss.elastic.co/t/siem-zeek-log-data-getting-error-decoding-json/191103/4 "2019-07-18T19:13:31Z")

</div>

Thanks for updating with the solution!

I'll create an issue to make this clearer in our docs, maybe point to this gist.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 15, 2019, 7:13pm UTC](https://discuss.elastic.co/t/siem-zeek-log-data-getting-error-decoding-json/191103/5 "2019-08-15T19:13:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
