# Bro + Log rotation (solr ?)

**URL:** https://community.zeek.org/t/bro-log-rotation-solr/3270
**Category:** Zeek
**Created:** [September 15, 2014, 10:38pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270 "2014-09-15T22:38:59Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Joe\_Blow](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@Joe\_Blow](https://community.zeek.org/u/Joe_Blow)
#### Post date: [September 15, 2014, 10:38pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270/1 "2014-09-15T22:38:59Z")

</div>

Hey all,

I’m using Bro + rsyslog filereader in order to pump Bro into our big data solution (Apache SOLR). I’m using custom python scripts to parse the incoming bro messages, batch them into appropriate sizes, and then POST them to the SOLR cluster we have setup. The main problem i’m running into is that rsyslog does not seem to ‘follow’ the files once they have gone through a Bro logrotate. Is there a way to completely disable logrotate? Has anyone had any luck with the Bro logrotate and not ‘losing’ file handles?

I’d love some help in this matter. Also - i know that Bro supports elastic search POSTing (via libcurl). Is there any reason why an apache SOLR module can’t be written/adapted? I don’t see a need to write to a file and worry about file handles, when it’s almost exactly the same to POST to SOLR as it is to ES. Since it’s all libcurl (and JSON) under the hood, i’d be glad to post/share the SOLR schemas i’ve created for the Bro data.

Thank in advance.

Cheers,

JB

---

<div class="post-metadata">

### Author: ![James\_inthe\_box](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@James\_inthe\_box](https://community.zeek.org/u/James_inthe_box)
#### Post date: [September 15, 2014, 10:56pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270/2 "2014-09-15T22:56:37Z")

</div>

I experienced the same thing, but since I rotate the files manually, I restart the syslog service after rotating and that's done the trick for me.

James

---

<div class="post-metadata">

### Author: ![Kurt\_Grutzmacher](https://avatars.discourse-cdn.com/v4/letter/k/ea5d25/32.png) [@Kurt\_Grutzmacher](https://community.zeek.org/u/Kurt_Grutzmacher)
#### Post date: [September 15, 2014, 11:40pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270/3 "2014-09-15T23:40:35Z")

</div>

Hey Joe,

It is possible with the current setup to write your own logging utility to pipe events directly to your system of choice. Since SOLR is REST-based just copy over the ElasticSearch module and do some code tweaking.

Be aware that the devs are working on a new modular method for extending Bro that will include logging. Should hopefully be a less-painful migration.

---

<div class="post-metadata">

### Author: ![Joe\_Blow](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@Joe\_Blow](https://community.zeek.org/u/Joe_Blow)
#### Post date: [September 16, 2014, 1:58pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270/4 "2014-09-16T13:58:37Z")

</div>

Hey James,

How exactly are you completely disabling the bro file rotation? This is why i tried in broctl.conf:

SitePolicyStandalone = local.bro  
CfgDir = /usr/local/bro/etc  
SpoolDir = /usr/local/bro/spool  
LogDir = /usr/local/bro/logs  
LogRotationInterval = 0  
MinDiskSpace = 5

But i still see gz files being created. Am i missing something to completely disable?

Cheers,

Justin

---

<div class="post-metadata">

### Author: ![James\_inthe\_box](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@James\_inthe\_box](https://community.zeek.org/u/James_inthe_box)
#### Post date: [September 16, 2014, 2:26pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270/5 "2014-09-16T14:26:25Z")

</div>

I don't use broctl, I use bro command line only. Something like:

/usr/local/bro/bin/bro --no-checksums -i eth0 local "Site::local\_nets += { 192.168.1.0/24 }"

James

---

<div class="post-metadata">

### Author: ![Daniel\_Thayer](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@Daniel\_Thayer](https://community.zeek.org/u/Daniel_Thayer)
#### Post date: [September 16, 2014, 3:10pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270/6 "2014-09-16T15:10:40Z")

</div>

After changing broctl.cfg, did you remember to run  
"broctl install"? Your changes do not take effect until  
you "install" them.

Next, you need to restart Bro ("broctl restart") so that  
Bro will read the new settings.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)
#### Post date: [May 6, 2022, 3:42pm UTC](https://community.zeek.org/t/bro-log-rotation-solr/3270/7 "2022-05-06T15:42:04Z")

</div>


