ProfessionalCommunity Edition

Configuring the Logger capture filter with scripts

  • Last updated: July 17, 2025

  • Read time: 4 Minutes

You can apply Java-based scripts to create custom capture filters for Logger. You can do this in two ways:

  • Load existing scripts - Load scripts from your Bambda library. This is your personal collection of reusable scripts. It includes any scripts you've created and saved, or ones you've imported, for example, from our GitHub repo. For more information, see Importing scripts.

  • Create new scripts - Write your own custom scripts. To get started quickly, use one of the built-in templates. These work out of the box and are easy to customize.

Note

Items that are not captured will be discarded from Logger. Burp can't retrieve these items even if the capture filter is removed.

Keyboard shortcuts

To speed up your workflow when creating or loading scripts, you can use the following keyboard shortcuts:

  • Save - Ctrl + S or Cmd + S

  • Save as - Ctrl + Shift + S or Cmd + Shift + S

  • Create new script - Ctrl + N or Cmd + N

  • Load recent script - Ctrl + O or Cmd + O

Loading scripts from your library

You can load and apply scripts that are stored in your library to filter which types of items Logger captures.

To load a script from your Bambda library:

  1. In the Logger tab, click the filter bar to open the Logger capture filter window.

  2. In the Logger capture filter window, click Script mode.

  3. Click Load.

  4. Select a recent script from the list.

  5. If the script you want to load isn't in the list, click View all to view all scripts stored in your library.

    1. Select a script.
    2. Click Load.
  6. [Optional] If required, edit the script:

    1. Make your changes.

    2. Click Apply to compile and test the script. Fix any errors shown in the Compilation errors panel. For more information, see Troubleshooting scripts.

    3. Save your changes:

      • To overwrite the existing script, click Save to library > Save.

      • To save a new version, click Save to library > Save as.

  7. Click Apply & close.

Burp compiles your script and applies it to any future traffic generated in this project.

Creating custom scripts

You can write your own scripts directly in the Script mode tab, using built-in templates or from a blank definition.

Note

Before you begin writing, we recommend exploring our Bambdas GitHub repository. There may be an existing script that meets your needs or provides inspiration for creating your own.

Converting filter settings to scripts

You can convert filter settings to a script as a starting point for further customization:

  1. In the Logger tab, click the filter bar to open the Logger capture filter window.

  2. Make changes to the filter settings as necessary.

  3. At the bottom of the Logger capture filter window, click Convert to script.

Your filter is converted into a script, enabling you to customize it further using Java.

Creating your script

Two objects of the Montoya API are available to help you write your script:

  • LoggerCaptureHttpRequestResponse

  • Utilities

To create a script to filter which types of items Logger captures:

  1. In the Logger tab, click the filter bar to open the Logger capture filter window.

  2. In the Logger capture filter window, click Script mode.

  3. If you want to create your script from a built-in template, select New > From template. Select a template from the list, then click Create using this template.

  4. Write your script using Java.

  5. Click Apply to compile and test the script. Fix any errors shown in the Compilation errors panel. For more information, see Troubleshooting scripts.

  6. [Optional] Click Save to library > Save. The script is saved to your Bambda library for future use across Burp.

  7. Click Apply & close.

Burp compiles your script and applies it to any future traffic generated in this project.

Warning

Capture filter scripts may slow down Burp's performance as they run against all outgoing HTTP messages. Using slow running or resource-intensive Bambdas can slow down Burp even further. Write your Bambda carefully to minimize performance implications.

Example script

In the example below, we'll create a script that filters Logger to capture only items that meet the following criteria:

  • The item must not have a MIME type of WOFF or WOFF2.

In this example, our script is:

var mimeType = requestResponse.mimeType(); return mimeType != MimeType.FONT_WOFF && mimeType != MimeType.FONT_WOFF2;

Related pages