Splunk Split Command: How to Use It

How-to basics · Updated November 22, 2026

The split command in Splunk divides the values of a single multivalue field into separate events, or splits a single field into multiple fields based on a delimiter. You use it with the syntax ... | split field_name to turn each value in a multivalue field into its own event, or ... | split field_name delim="-" to break a string field into multiple fields. This is one of the most frequently used commands in Splunk for normalizing data, especially when dealing with logs that contain comma-separated lists or repeated key-value pairs.

What the Split Command Actually Does

The split command operates on one field at a time. When you run | split my_field, Splunk looks at every event in the current result set and checks whether my_field contains multiple values (a multivalue field). If it does, Splunk creates one new event for each value, copying all other fields from the original event into each new event. If the field is a single string, the command does nothing unless you specify a delim parameter.

For example, if you have an event with user=alice and roles=admin,editor,viewer (where roles is already a multivalue field), running | split roles produces three events: one with roles=admin, one with roles=editor, and one with roles=viewer. Each of those new events still has user=alice. This is the core use case: turning one wide event into multiple narrow events for easier analysis.

Split vs. Makemv: Key Differences

Many users confuse split with makemv. The critical difference is what happens to the event count. makemv converts a single string into a multivalue field within the same event — the event count stays the same, and the field now holds multiple values. split then takes those multiple values and creates separate events.

In practice, you often use them together. First makemv to split a delimited string into a multivalue field, then split to expand those values into individual events. For instance, to break a comma-separated list in a field called tags, you would write: ... | makemv delim="," tags | split tags. Without the makemv step, split tags would do nothing because tags is a single string, not a multivalue field.

Using the delim Parameter for String Fields

If you want to split a single string field into multiple fields (not events), you use the delim parameter. The syntax is | split field_name delim="-". This takes the string value of field_name and breaks it at each delimiter occurrence, creating new fields named field_name_1, field_name_2, and so on. The original field is removed.

Example: if an event has ip_port=192.168.1.1:8080, running | split ip_port delim=":" creates ip_port_1=192.168.1.1 and ip_port_2=8080. This is handy for parsing structured strings like URLs or file paths. Note that the delimiter is a literal string, not a regular expression — so delim="." splits on a literal period, not any character. If you need regex-based splitting, use rex or erex instead.

Common Pitfalls and Errors

The most frequent mistake is expecting split to work on a string field without delim. If the field is not multivalue, the command silently does nothing — no error, no warning. Always check your data with | stats count by field_name or | fieldsummary to see if the field is multivalue.

Another issue is the limit parameter. By default, split will create up to 100 new events per original event. If your multivalue field has more than 100 values, you will lose the extras unless you specify | split field_name limit=0 (which removes the limit) or a higher number. For very large multivalue fields (thousands of values), be aware that this can exponentially increase your result set size, potentially hitting search limits or slowing down your query.

A third pitfall: when using delim to create multiple fields, the new fields are strings. If you later need to perform numeric operations on field_name_2, you must cast it with tonumber() or use eval to convert it.

Practical Examples for Real Searches

  • Expanding a list of IPs: index=firewall | makemv delim=" " src_ips | split src_ips | stats count by src_ips — this turns a space-separated list of source IPs into individual events and counts them.
  • Parsing a key-value string: index=app | split kv_string delim=";" | rename kv_string_1 AS key1, kv_string_2 AS key2 — splits a semicolon-delimited string into separate fields and renames them for clarity.
  • Breaking a CSV line: ... | split csv_line delim="," | table csv_line_1 csv_line_2 csv_line_3 — useful for handling raw CSV data ingested as a single field.
  • Combining with where: ... | split user_roles | where user_roles="admin" — after splitting, you can filter events that contain a specific value, which is impossible before splitting.

Performance Considerations and Alternatives

Using split on a large result set can be memory-intensive because each new event duplicates all other fields. If you only need to count occurrences of values, consider using mvexpand instead — it does the same thing as split for multivalue fields but is often faster and more efficient. The syntax is | mvexpand field_name and it is the recommended command for most multivalue expansion scenarios in modern Splunk versions. split remains useful for the delim field-splitting feature, which mvexpand does not offer.

Another alternative for string splitting is the eval function split(), which creates a multivalue field from a string: | eval new_field=split(original, ","). This is a one-step version of makemv and is often clearer. Then you can use mvexpand on the result. For simple cases, prefer eval split() over the two-step makemv + split.

Frequently Asked Questions

Does split work on fields that are already multivalue?

Yes, that is its primary purpose. If a field already contains multiple values (e.g., from a makemv or a stats values() command), split will expand each value into its own event. If the field is a single string, it does nothing unless you provide a delim.

What is the difference between split and mvexpand?

Functionally they are identical for multivalue fields — both create one event per value. The difference is that mvexpand is the newer, recommended command and generally performs better. split has the additional capability of splitting a single string into multiple fields using delim, which mvexpand cannot do.

How do I split a comma-separated string into separate events?

Use | makemv delim="," field_name | split field_name. The makemv step converts the comma-separated string into a multivalue field, then split expands it into events. Alternatively, use | eval new_field=split(field_name, ",") | mvexpand new_field for a single-line approach.

Can I split a field into multiple fields without creating new events?

Yes, use | split field_name delim="-". This creates new fields named field_name_1, field_name_2, etc., in the same event. The original field is removed. This is useful for parsing structured strings like host-01 into host-01_1=host and host-01_2=01.

What happens if the delimiter appears multiple times?

Each occurrence creates a new field. For example, split path delim="/" on /usr/local/bin produces path_1 (empty), path_2=usr, path_3=local, and path_4=bin. Empty segments are preserved, so be aware of leading or trailing delimiters.

Is there a limit to how many events split can create?

Yes, by default the limit parameter is 100. Use | split field_name limit=0 to remove the limit, but be cautious — this can create a massive number of events and slow down your search significantly. It is often better to filter before splitting.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.