Developer Tools
StatsD Line Parser
Parse StatsD and DogStatsD lines into name, value, type, sample rate, and tags. Decode every metric type, flag mistakes, and build a valid line. No signup.
StatsD line parser and builder
Quick samples
Paste the contents of a StatsD packet, an application log line, or any batch of metric lines. Each line is read as name:value|type with an optional @sample-rate and #tag block.
Summary
Metrics
4
Lines
4
Errors
0
Notes
0
Types
Parsed metrics
4 metricspage.viewsccounterAdds the value to a bucket each flush. A sample rate scales the count back up.
page.views:1|c- Value
- 1
- Sample rate
- 1 (default)
- Tags
- none
service.memoryggaugeHolds an arbitrary value. A leading + or - applies a delta instead of setting it.
service.memory:512|g- Value
- 512
- Sample rate
- 1 (default)
- Tags
- none
request.latencymstimerA timing in milliseconds. The server derives mean, percentiles, and bounds.
request.latency:320|ms- Value
- 320
- Sample rate
- 1 (default)
- Tags
- none
unique.usersssetCounts unique members in the flush window. The value is a member, not a number.
unique.users:765|s- Member
- 765
- Sample rate
- 1 (default)
- Tags
- none
Export
One object per metric, with type, value, sample rate, and tags.
JSON
[
{
"name": "page.views",
"type": "counter",
"typeCode": "c",
"value": 1,
"delta": false,
"sampleRate": null,
"tags": {}
},
{
"name": "service.memory",
"type": "gauge",
"typeCode": "g",
"value": 512,
"delta": false,
"sampleRate": null,
"tags": {}
},
{
"name": "request.latency",
"type": "timer",
"typeCode": "ms",
"value": 320,
"delta": false,
"sampleRate": null,
"tags": {}
},
{
"name": "unique.users",
"type": "set",
"typeCode": "s",
"value": "765",
"delta": false,
"sampleRate": null,
"tags": {}
}
]NDJSON
{"name":"page.views","type":"counter","typeCode":"c","value":1,"delta":false,"sampleRate":null,"tags":{}}
{"name":"service.memory","type":"gauge","typeCode":"g","value":512,"delta":false,"sampleRate":null,"tags":{}}
{"name":"request.latency","type":"timer","typeCode":"ms","value":320,"delta":false,"sampleRate":null,"tags":{}}
{"name":"unique.users","type":"set","typeCode":"s","value":"765","delta":false,"sampleRate":null,"tags":{}}Line protocol reference
The grammar a StatsD line follows, summarized in one place. This tool reads and writes the same rules.
Line shape
name:value|type|@rate|#tag:val,tag2
- The @rate and #tag block are optional.
- Pack values with colons: name:1:2:32|d.
- One metric per line; newline separates a packet.
Metric types
ccounter,ggaugemstimer,ssethhistogram,ddistribution (DogStatsD)
Gauges and sampling
gaugor:+4|gadds 4;gaugor:-2|gsubtracts 2.api:1|c|@0.1means one in ten were sent.- The server scales a sampled counter back up.
Tags
#env:prod,region:euis two key-value tags.- A bare key with no value is allowed, like #beta.
- Tags are a DogStatsD addition, not core StatsD.
How to use
- Paste one or more StatsD or DogStatsD lines into the box, one metric per line, or load a sample such as Core types or DogStatsD tags.
- Read each metric card: the decoded name, the metric type with its meaning, the value or set member, the sample rate, and any tags.
- Watch the type chips and the delta marker on gauges that use a leading + or - to change the value rather than set it.
- Check the errors panel for lines that would be dropped at a collector, and the notes panel for softer warnings like an unusual sample rate.
- Use Copy JSON or Copy NDJSON to export every parsed metric as structured data.
- Switch to Build a line to assemble a valid line from a form, with the type, sample rate, and tag block written in the correct order.
About this tool
StatsD Line Parser reads the metric lines that StatsD speaks: the short, pipe-delimited datagrams that application code, Telegraf, the Datadog Agent, and the original Etsy StatsD daemon send over UDP or TCP. The grammar fits on one line but the details matter, so this tool implements the documented rules. A line is name:value|type, with an optional sample rate and an optional tag block: name:value|type|@rate|#tag:value,tag2. The parser splits the name at the first colon, reads the value section, then walks the pipe-separated fields for the type, the @rate, and the #tags in whatever order they appear. Every metric type is recognized and labelled with what it means: c is a counter that adds to a bucket each flush, g is a gauge that holds a value, ms is a timer in milliseconds, s is a set that counts unique members, and the two DogStatsD additions, h for a histogram and d for a distribution, round out the set. Gauges are handled correctly: a leading + or - is not part of the number, it is a delta that changes the gauge by that amount instead of setting it, so queue.depth:+4|g and queue.depth:-2|g are shown as deltas, not as the values 4 and -2. Value packing is supported too, the DogStatsD shorthand that sends several readings on one line as 1:2:32, so a packed distribution or histogram is split into its individual values. The sample rate is parsed and checked against the usual (0, 1] range, which is how a client tells the server that it sent one in ten or one in two, and the server scales the count back up. Tags are parsed into key and value pairs, with a bare key allowed when a tag carries no value. It is a linter as well as a reader. It flags the mistakes that silently drop metrics at the collector: a line with no colon or no type, a value that is not a number, a type that is not one of the six codes, a sample rate that is not a number or sits outside the normal range, an empty or stray field from a doubled pipe, and a tag block that is empty. Each parsed line is laid out as a card with a colored type chip, the value or set member, the sample rate, and the tag list, and the whole batch exports as JSON or NDJSON with the type spelled out, the value or packed values, a delta flag for gauges, the sample rate, and the tags as an object, ready for a script, a test fixture, or a spreadsheet. A build mode goes the other way: pick a type, enter a value, choose set-or-delta for a gauge, add a sample rate and tags, and the tool assembles one valid line with the pipe fields and tag block in the right order. One honest limit: this reads and writes the StatsD text, it is not a StatsD server. It does not listen on a socket, receive from a client, aggregate, or flush. Everything runs locally in your browser, so the lines you paste or build are never uploaded or logged.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Prometheus Metrics Parser
Read /metrics exposition text into metric families with labels and values, export JSON or NDJSON, or build a valid metric line.
Open tool
DeveloperInfluxDB Line Protocol Parser
Read InfluxDB and Telegraf line protocol into typed points with tags and fields, export JSON or NDJSON, or build a valid line.
Open tool
DeveloperLogfmt Parser and Formatter
Parse logfmt to JSON or NDJSON and emit clean logfmt from JSON, NDJSON, or rows.
Open tool
DeveloperAccess Log Parser
Parse Apache CLF, Combined, and NGINX access logs into a sortable, exportable table.
Open tool
Date & TimeUnix Timestamp Converter
Convert epoch timestamps to dates and back.
Open tool
DeveloperJSON Formatter
Format, minify, and validate JSON in your browser.
Open tool