# Capturing events

**URL:** https://community.zeek.org/t/capturing-events/921
**Category:** Zeek
**Created:** [February 2, 2006, 4:03pm UTC](https://community.zeek.org/t/capturing-events/921 "2006-02-02T16:03:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![David\_Vasil1](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@David\_Vasil1](https://community.zeek.org/u/David_Vasil1)
#### Post date: [February 2, 2006, 4:03pm UTC](https://community.zeek.org/t/capturing-events/921/1 "2006-02-02T16:03:27Z")

</div>

I noticed the capture-events.bro policy and loaded it; it has been generating an events.bst file in my logs directory with data inside of it. My question is: what can I get out of this file? Is this just a raw packet capture of anything that is flagged by a policy?

Also, I tried replaying the file using bro -R events.bst and it appears to be waiting for standard input. When I try and specify a policy to use on the command line it errors with:

[root@endace bro]# bin/bro -R /scratch/bro/logs/events.bst http  
./site, line 1: error: read failed with "Is a directory"

I searched through the documentation and saw no reference to 'replay' 'events.bst' or even '.bst'.

Also, where can I get the start-capture-all script? Is this just a wrapper around tcpdump; or does it grab the data before/after bro looks at the stream? Unfortunately with the DAG capture cards I am testing with, only one application can read from the device at a single time. Any suggestions? Thanks!

---

<div class="post-metadata">

### Author: ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)
#### Post date: [February 2, 2006, 6:34pm UTC](https://community.zeek.org/t/capturing-events/921/2 "2006-02-02T18:34:59Z")

</div>

> I noticed the capture-events.bro policy and loaded it; it has been  
> generating an events.bst file in my logs directory with data inside of  
> it. My question is: what can I get out of this file? Is this just a  
> raw packet capture of anything that is flagged by a policy?

It's a capture of all events which were generated during run-time,  
e.g., things like connection\_established and http\_request.  
Events.bst contains all raised events including their timestamps and  
parameters, so it's a very convenient way to understand what's going  
on during operation (for large traffic streams it gets huge though  
and may therefore be more suitable for smaller experiments).

You can display the contents of the file with the -x option:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;bro -x events.bst any-scripts-used-in-the-original-Bro-run.bro

> Also, I tried replaying the file using bro -R events.bst and it appears  
> to be waiting for standard input.

The replay mechanism might actually be broken right now due to  
internal changes. I'll look at it.

> I searched through the documentation and saw no reference to 'replay'  
> 'events.bst' or even '.bst'.

Uhm, that's right. Unfortunately, the best documentation of new  
features is still the "CHANGES".

Robin

---

<div class="post-metadata">

### Author: ![David\_Vasil1](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@David\_Vasil1](https://community.zeek.org/u/David_Vasil1)
#### Post date: [February 2, 2006, 6:47pm UTC](https://community.zeek.org/t/capturing-events/921/3 "2006-02-02T18:47:01Z")

</div>

Would you recommend using BRO\_CREATE\_TRACE\_FILE=YES instead of event-capture.bro? Besides being in a raw tcpdump format, what other benefits does the trace file give me? Thanks!

---

<div class="post-metadata">

### Author: ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)
#### Post date: [February 2, 2006, 7:25pm UTC](https://community.zeek.org/t/capturing-events/921/4 "2006-02-02T19:25:14Z")

</div>

The tracefile gives you a comprehensive view of the network  
activity: it contains exactly the data on which Bro performed the  
analysis; by refeeding the trace into Bro again, you get the same  
results. The single most important advantage of a trace is that you  
can manually examine it afterwards to see why Bro reported  
something, in case the usual logs are not sufficient. If your  
environmnent allows it (in terms of available resources, network  
volume, and organisational restrictions), capturing a trace is a  
good thing.

events.bst is a bit different: it does not contain the raw traffic  
but a higher-level abstraction of it; you loose information as you  
only see the data in a state when Bro has already performed its  
first step of analysis (i.e. after a large reduction in volume).  
This may or may not be sufficient to track things down, though  
usually most of the data contained in events.bst ends up in some log  
file anyway.

I usually do not routinely use capture-events with an operational  
Bro. I Rather turn it on selectively if I need to understand how  
exactly Bro generates events for some given input, e.g., to tweak a  
policy script. Then it's really helpful as you exactly see what the  
policy scripts see as well, including timing.

Robin

---

<div class="post-metadata">

### Author: ![Brian\_Tierney](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@Brian\_Tierney](https://community.zeek.org/u/Brian_Tierney)
#### Post date: [February 3, 2006, 12:37am UTC](https://community.zeek.org/t/capturing-events/921/5 "2006-02-03T00:37:53Z")

</div>

I use event-capture.bro mainly for debugging processing of external events sent to Bro via  
Broccoli. For example, we convert syslog events to something bro understands and send them  
to Bro for analysis via Broccoli.

---

<div class="post-metadata">

### Author: ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)
#### Post date: [February 4, 2006, 1:02am UTC](https://community.zeek.org/t/capturing-events/921/6 "2006-02-04T01:02:30Z")

</div>

Will be fixed in the next release.

Robin

---

<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:37pm UTC](https://community.zeek.org/t/capturing-events/921/7 "2022-05-06T15:37:47Z")

</div>


