From Elastic Integration Skills
Anonymize and sanitize customer-provided log files before they are committed as pipeline test fixtures or sample events. Performs a line-by-line review and replaces all sensitive values inline, preserving log structure and format exactly — never reformats, re-indents, or restructures content. Invoke manually with /anonymize-logs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/integration-skills:anonymize-logsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Sanitize customer-provided log files so they are safe to commit to source control.
Sanitize customer-provided log files so they are safe to commit to source control.
| Input | How to provide |
|---|---|
| Log file(s) to sanitize | @-mention files or paste inline |
| Output location (optional) | free text path, defaults to same directory with .sanitized suffix |
| In-place override (optional) | say "in place" to overwrite the original |
Only replace sensitive values. Do not touch anything else.
The ingest pipeline parser depends on exact whitespace, delimiters, quoting, and line structure.
Read every line and replace all sensitive values inline. Cover at minimum:
token_prefix, password_hash_prefix, hashed_token) — partial exposure still identifies the credential[email protected]), email subjects and body texthome_tenant_id, resource_tenant_id, aad_tenant_id variants), account IDs, subscription IDs, billing account IDs, org slugs embedded in paths or JSON fields, org unit paths (e.g. orgunit_path, org_unit_path), department names and IDs, cost center IDs, Windows SIDs (Security Identifiers) in pipe names, task names, or registry pathsdatabase.host, database.name, database_principal_name), Windows domain topology fields (domain controller hostnames, NT domain names, domain_controller_object_guid, domain_controller_object_sid)C:\Users\alice\, /home/bob/, HKLM\...\S-1-5-21-...)Apply placeholder conventions and shape rules (see below) as you go.
Confirm after sanitization:
python3 -c "
import json, sys
with open('FILE') as f:
for i, line in enumerate(f, 1):
line = line.strip()
if line:
try: json.loads(line)
except Exception as e: print(f'Line {i}: {e}')
"
Use consistent, realistic-looking replacements — not REDACTED strings, which break format-sensitive parsers.
| Type | Replacement |
|---|---|
[email protected], [email protected] | |
| IPv4 | RFC 5737 ranges: 198.51.100.10, 203.0.113.20, 192.0.2.30 |
| IPv6 | 2001:db8::10 |
| Hostname / FQDN | host-1.example.local, srv-web-01.example.internal |
| Domain | example.com, example.org, example.net |
| UUID | 89a1d5c1-2b3e-4f67-8a9b-0c1d2e3f4a5b |
| API key / token | sk_test_example_key_1234567890, dGVzdC10b2tlbi0xMjM0NTY3ODk= |
| Username | alice.johnson, bob.smith |
| Display name | Alice Johnson, Bob Smith |
| Org / company name | Example Corp, Acme Inc |
| Account / tenant ID | 000000000000, example-tenant-id |
| Cloud resource ID | arn:aws:iam::000000000000:user/example-user |
| S3 bucket name | example-bucket |
| MAC address | 00-00-5E-00-53-23 (RFC 7042 documentation range) |
| Serial number | SN000000000001 |
| Device / machine ID | use a synthetic UUID or device-id-example-000001 |
| Windows SID | S-1-5-21-000000000-000000000-000000000-1000 |
| File path (Windows) | C:\Users\example-user\AppData\... |
| File path (Unix) | /home/example-user/... or use ~ |
| Kubernetes cluster | example-cluster, example-node-1 |
| Phone number | 734-555-0100 (555 range is reserved for fiction) |
| Database host / name | db-host.example.local, example_database |
| Department / org unit | example-department, /example-org/example-unit |
| Hashed / partial token | replace with full synthetic token of same format |
| DHCP fingerprint | example-dhcp-fingerprint-000001 |
| JA4 fingerprint | replace with same-length hex string |
| Transaction / sequence / event-instance ID (numeric) | synthetic integer matching the original digit count — e.g. 48273915 → 10000002 |
| Session / request / correlation ID | same-length synthetic string (preserve length and charset), not a descriptive name |
Consistency rule: map identical original values to identical placeholders throughout the file. If the same IP appears 10 times, it must become the same replacement IP all 10 times — so cross-event correlations remain testable.
Every replacement must have the same shape as the original value. The parser and pipeline conditions depend on value format, not just field presence.
/d/123/edit → /d/456/edit, not /d/example-document-id/editcn1=48273915 cn2=3061847 → cn1=10000002 cn2=1000002https://docs.google.com/drawings/d/123/edit → https://docs.google.com/drawings/d/000000000000/edit (replace the ID, not the host — docs.google.com is a public service name, not an org identifier)https://internal.corp.com/api/v1/resource → https://host-redacted.example.local/api/v1/resource (replace the internal hostname, keep the path)docs.google.com, api.github.com, s3.amazonaws.com) identify a service, not an organization, and do not need to be replacedMalformed or garbage values must not be replaced. If a value looks broken, synthetic, or contains no real identifying information (e.g. http://1=Y +z\\, 00/00/0000, N/A, empty strings, placeholder-looking values), leave it exactly as-is. Replacing a malformed value with a well-formed placeholder changes the shape and can alter pipeline behaviour — a grok that fails on the original will now succeed on the sanitized version, masking the real error.
If you are unsure what shape to use, look at neighbouring values of the same field type in the same file and match their format.
Do not replace:
ALLOW, DENY, INFO, ERROR)docs.google.com, api.github.com, etc.) — replace the path ID if it is sensitive, not the hostMozilla/5.0 ...) — these reveal browser/OS type but not identity; safe to keepnpx claudepluginhub elastic/integration-skills --plugin integration-skillsCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.