I need to delete a lot of columns. How can I do that?
Last updated: October 17, 2025
This article provides an in-depth overview of the tool for cleaning up unwanted columns in bulk within Honeycomb environments. This tool is particularly useful for improving performance, as environments with large numbers of columns (over 30,000) can experience slow trace loading times.
The Python script for deleting columns in bulk can be found on GitHub: https://github.com/honeycombio/field-utils/blob/main/tools/hny_dataset_cleanup_tool/hny-column-cleanup.py
Column Cleanup Tool (hny-column-cleanup.py)
Prerequisites
Python 3.11 or later
Python
requestslibrary (pip install requests)Honeycomb API key with “Manage Queries and Columns” permission
Usage
python hny-column-cleanup.py -k API_KEY -d DATASET [options]Required Arguments
-k,--api-key: Honeycomb API key.-d,--dataset: Target dataset to clean.
Optional Arguments
-a,--api-host: Honeycomb API hostname (default:api.honeycomb.io).-m,--mode: Type of columns targeted:hidden: Hidden columns.spammy: Columns containing spammy strings (potentially created during pentesting)date: Columns created on a specific date.last_written_before: Columns not written to since a specified date.regex_pattern: Columns matching a regex pattern.
--date YYYY-MM-DD: Required withdateorlast_written_beforemodes.--regex_pattern: Required withregex_patternmode.--dry-run: Preview columns targeted without deleting.
Examples
Preview hidden columns removal:
python hny-column-cleanup.py -k YOUR_API_KEY -d dataset_name -m hidden --dry-runDelete regex-matched columns:
python hny-column-cleanup.py -k YOUR_API_KEY -d dataset_name -m regex_pattern --regex_pattern '^test_.*'Remove columns created on a specific date:
python hny-column-cleanup.py -k YOUR_API_KEY -d dataset_name -m date --date 2023-03-10Remove columns not written to since a specific date:
python hny-column-cleanup.py -k YOUR_API_KEY -d dataset_name -m last_written_before --date 2023-06-01
Note: By default, the DELETE Column API endpoint has a rate limit of 50 requests per minute. Hitting the rate limit will give a 429 response. If this is causing large deletions to take an excessive amount of time, please contact Support.
Best Practices
Always perform a dry-run first to verify the targeted datasets or columns.
Validate targets carefully, particularly when using regex patterns or date-based criteria.
Consider regular column cleanup to maintain optimal performance, especially if your environment has thousands of columns that may be impacting trace loading times.
Related Links:
How to delete unused columns in a dataset
Still need help?
Contact Support, and we'll do our best to assist you. You can find all the ways to get in touch with us at Honeycomb Support.