printing metrics to screen

I’ve tried to figure this out for awhile…

How can I print a metric I’m tracking to screen to confirm it’s doing what I think it’s doing?

Thanks!

Hi JP,

Are you running bro from the command as part of your development cycle? i.e. you make changes, run a test pcap through bro via bro -r mytestpcap.pcap myscript.bro ?

If so you can just use print and fmt() to generate output.

v/r
Scott

When you say "metric", are you referring to something you're doing with the Metrics framework?

  .Seth

Sorry didn’t reply all -

Seth - I’m trying to figure out how to print out Metrics values stored with the Metrics Framework. So if I’m watching something, how can I figure out the state or values of everything in order to understand that what I think is happening is happening.

The metrics (soon measurement) framework is undergoing heavy rewrites right now and I'm hoping to get the latest refactor pushed out very soon, I'm working on it a lot right now. One of the big changes has been to change it into more of a utility intended to help you accomplish goals instead of trying to accomplish everything on it's own. What's in 2.0 and 2.1 was written to solve very few situations. What I'm working on now has a much broader range of applicability and capability.

I guess what I'm trying to say is that I think what you're trying to do isn't possible with the version of the metrics framework you're using. :slight_smile:

  .Seth