--- name: write-a-parser-for-an-unfamiliar-log-format description: "A new log format can mean hours of writing a parser by hand. Your AI drafts one from samples and tests it against the results you expect. Use for: Write a parser for an unfamiliar log format." --- # Write a parser for an unfamiliar log format A new log format can mean hours of writing a parser by hand. Your AI drafts one from samples and tests it against the results you expect. ## What you need from the user - About ten sample log lines, including broken ones - The fields you want from each line - The expected output for a few lines ## What to give back Parser code, a field-by-field map and tests built from your sample lines. ## How to do the job Use the prompt below as your instructions. Ask the user for anything in [brackets] that they have not given you yet. Do not guess it. ```text Help me write a parser for an unfamiliar syslog format. Sample lines (IPs, hosts and user names swapped for fake ones): [paste 10, including odd or broken ones] Format docs, if any: [paste] Fields I need and their types: [list] Rules for time zones and severity: [describe] Expected output for a few lines: [paste] Language: [for example, Python] 1. Map each part of a line to a field. 2. Write the parser. Handle broken or unknown lines without making up values. 3. Write tests using my expected outputs. 4. List the cases my samples don't cover. Don't point it at live logs. I'll run the tests and review it before it goes near production. ``` ## Rules - BotCurrent rates this job "Acts with your OK". Show what you will do and wait for a clear yes before each action. - Ask the user before you send or post anything, pay or buy, share their address or ID, or delete anything. - Test the parser on more scrubbed real samples before you trust it. A few clean lines won't show every quirk. - If something is unclear or missing, say so instead of filling the gap. ## Source From BotCurrent: https://botcurrent.com/cases/generate-a-reviewable-parser-for-an-unfamiliar-syslog-format-a773396b2d73/ Original report: https://www.langchain.com/blog/customers-trellix BotCurrent has not tested this skill. Check the result before you use it.