This tool helps you extract all tag hierarchies from an Immuta Governance interface. It identifies and organizes tags into their hierarchical structure and exports them to a CSV file for easy analysis.
This toolkit contains two main JavaScript files:
expand-all-sections.js
: Expands all collapsible sections in the Immuta interfaceimmuta-tag-hierarchy-extractor.js
: Extracts all tags with their complete hierarchies
- Access to an Immuta instance
- Modern web browser (Chrome, Firefox, Edge, or Safari)
- Basic familiarity with browser developer tools
-
Log in to your Immuta instance
Open your web browser and log in to your Immuta platform.
-
Navigate to the Tags page
Go to the Governance section where tags are managed.
-
Open browser developer tools
- In Chrome/Edge: Press
F12
or right-click anywhere on the page and select "Inspect" - In Firefox: Press
F12
or right-click and select "Inspect Element" - In Safari: First enable developer tools in Safari > Preferences > Advanced, then press
Command+Option+I
- In Chrome/Edge: Press
-
Go to the Console tab
Click on the "Console" tab in the developer tools panel.
-
Enable copy functionality (if needed)
Some environments restrict copying content from web applications. If you encounter issues, run:
document.designMode = "on";
After extraction is complete, you can turn it off with:
document.designMode = "off";
-
Expand all sections
To ensure all tags are visible, copy and paste the entire
expand-all-sections.js
script into the console and press Enter.Wait until you see a message like "✅ Successfully expanded X sections" and no more "running again" messages appear.
-
Extract the tag hierarchies
Copy and paste the entire
immuta-tag-hierarchy-extractor.js
script into the console and press Enter. -
Check the downloaded CSV file
The script will automatically download a file named
immuta_tags_hierarchical.csv
. Check your browser's download location if it doesn't appear. -
Analyze the results
Open the CSV file in Microsoft Excel, Google Sheets, or any spreadsheet application. The file has a special format:
- The first column contains the leaf node (actual tag)
- Subsequent columns show the complete hierarchy from root to leaf
The CSV file has the following structure:
Leaf Node | Level 1 | Level 2 | Level 3 | ... |
---|---|---|---|---|
"Tag1" | "Governance" | "Category1" | "Tag1" | |
"Tag2" | "Governance" | "Category1" | "Subcategory" | "Tag2" |
- Leaf Node column: Contains the actual tag name for easy identification
- Level columns: Show the complete hierarchy path from the root to the leaf
This script:
- Finds all elements with the chevron-down icon class
- Identifies their clickable parent elements
- Simulates clicks to expand collapsed sections
- Runs recursively to handle newly revealed nested sections
This script:
-
Identifies tags using multiple detection strategies:
- Finds elements with specific classes (e.g.,
mat-button-wrapper
) - Locates elements with specific attributes (e.g.,
data-test-bind="tag-title"
) - Uses XPath patterns to find deeply nested tags
- Finds elements with specific classes (e.g.,
-
Builds hierarchical paths by:
- Starting from each identified tag
- Traversing up the DOM tree to find parent categories
- Building a complete path from root to leaf
-
Processes and exports data by:
- Cleaning and normalizing tag names
- Removing duplicates and sorting hierarchies
- Creating a properly formatted CSV with a leaf node column
- Automatically downloading the file
- No tags found: Make sure you're on the correct Governance/Tags page and try running the expand script again
- Missing hierarchies: Some deeply nested tags might not be detected; try expanding all sections manually
- Script errors: Check the console for error messages; they may indicate permission issues or UI changes
- CSV format issues: If the CSV doesn't open correctly, try importing it with explicit UTF-8 encoding
- The script depends on the current Immuta UI structure; future UI updates may require script modifications
- Very large tag hierarchies might take time to process
- The script can only extract tags visible in the UI; hidden or paginated content might be missed