@@ -372,92 +372,6 @@ on the command line:
372372 mkdir output_directory ; zeek -r mypackets.trace Log::default_logdir=output_directory
373373
374374
375- Tracing Events
376- --------------
377-
378- Zeek provides a mechanism for recording the events that occur during
379- an execution run (on live traffic, or from a pcap) in a manner that you
380- can then later replay to get the same effect but without the traffic source.
381- You can also edit the recording to introduce differences between the original,
382- such as introducing corner-cases to aid in testing, or anonymizing sensitive
383- information.
384-
385- You create a trace using:
386-
387- .. code-block :: console
388-
389- zeek --event-trace=mytrace.zeek <traffic-option> <other-options> <scripts...>
390-
391- or, equivalently:
392-
393- .. code-block :: console
394-
395- zeek -E mytrace.zeek <traffic-option> <other-options> <scripts...>
396-
397- Here, the *traffic-option * would be ``-i `` or ``-r `` to arrange for
398- a source of network traffic. The trace will be written to the file
399- ``mytrace.zeek `` which, as the extension suggests, is itself a Zeek script.
400- You can then replay the events using:
401-
402- .. code-block :: console
403-
404- zeek <other-options> <scripts...> mytrace.zeek
405-
406- One use case for event-tracing is to turn a sensitive PCAP that can't
407- be shared into a reflection of that same activity that - with some editing, for
408- example to change IP addresses - is safe to share. To facilitate such
409- editing, the generated script includes at the end a summary of all of
410- the constants present in the script that might be sensitive and require
411- editing (such as addresses and strings), to make it easier to know what
412- to search for and edit in the script. The generated script also includes
413- a global ``__base_time `` that's used to make it easy to alter (most of)
414- the times in the trace without altering their relative offsets.
415-
416- The generated script aims to ensure that event values that were related
417- during the original run stay related when replayed; re-execution should
418- proceed in a manner identical to how it did originally. There are however
419- several considerations:
420-
421- * Zeek is unable to accurately trace events that include values that cannot
422- be faithfully recreated in a Zeek script, namely those having types of
423- ``opaque ``, ``file ``, or ``any ``. Upon encountering these, it generates
424- variables reflecting their unsupported nature, such as ``global
425- __UNSUPPORTED21: opaque of x509; ``, and initializes them with code like
426- ``__UNSUPPORTED21 = UNSUPPORTED opaque of x509; ``. The generated script
427- is meant to produce syntax errors if run directly, and the names make
428- it easy to search for the elements that need to somehow be addressed.
429-
430- * Zeek only traces events that reflect traffic processing, i.e., those
431- occurring after :zeek:id: `network_time ` is set. Even if you don't include
432- a network traffic source, it skips the :zeek:id: `zeek_init ` event
433- (since it is always automatically generated).
434-
435- * The trace does *not * include events generated by scripts, only those
436- generated by the "event engine".
437-
438- * The trace is generated upon Zeek cleanly exiting, so if Zeek crashes,
439- no trace will be produced. Stopping Zeek via *ctrl-c * does trigger a
440- clean exit.
441-
442- * A subtle issue arises regarding any changes that the scripts in the
443- original execution made to values present in subsequent events. If
444- you re-run using the event trace script as well as those scripts,
445- the changes the scripts make during the re-run will be discarded and
446- instead replaced with the changes made during the original execution.
447- This generally won't matter if you're using the exact same scripts for
448- replay as originally, but if you've made changes to those scripts, then
449- it could. If you need the replay script to "respond" to changes made
450- during the re-execution, you can delete from the replay script every
451- line marked with the comment ``# from script ``.
452-
453- .. note ::
454-
455- It's possible that some timers will behave differently upon replay
456- than originally. If you encounter this and it creates a problem, we
457- would be interested to hear about it so we can consider whether the
458- problem can be remedied.
459-
460-
461375 Telling Zeek Which Scripts to Load
462376----------------------------------
463377
0 commit comments