Splunk Search

Is there any online regex tool to create regular expressions for given sample data ?


Is there any online regex tool to create regular expressions for given sample data ?

Tags (1)

New Member

If you want to build regex using plain simple English for your sample data & test matches also then you can use https://itsallbinary.com/simply-regex/regex-builder-tool

You can simply use plain English phrases from auto suggestions & tool will generate regex for it. You can also test generated regex right there with your sample data as asked in question. One example of capturing log statement from this tool -

_Match_anywhere_in_text_ _any_digit_ _then_ _exact_string_ ( /) _then_ _any_digit_ _then_ _exact_string_ ( /) _then_ _one_or_more_of_ ( _any_digit_) _then_ _any_whitespace_ _then_ _exact_string_ ( -) _then_ _any_whitespace_ _then_ _capture_this_ ( _one_or_more_of_ ( _as_less_as_possible_of_ _any_character_)) _then_ _any_whitespace_ _then_ _exact_string_ ( -) _then_ _capture_this_ ( _one_or_more_of_ ( _any_character_ )) _then_ _exact_string_ ( -) _then_ _capture_this_ ( _one_or_more_of_ ( _any_character_))

This generates complex regex: \d\/\d\/(?:\d)+\s\-\s((?:.)+?)\s\-((?:.)+)\-((?:.)+)

You can also test with your sample data: 6/7/2020 - MyClass - Today is Sunday and yesterday was Saturday - Success

It will match regex with your sample data & show groups:

Full Match = '6/7/2020 - MyClass - Today is Sunday and yesterday was Saturday - Success'
Group 1 = 'MyClass'
Group 2 = ' Today is Sunday and yesterday was Saturday '
Group 3 = ' Success'


0 Karma

New Member

RegexGenerator++ generates a regular expression starting from given data.

0 Karma


As a regular expression generator (log entry as input, regex as output) you can also use the one under:


It provides a generic regex with URLs, IPs, ports, usernames and so on parsed at some extent.


The other sites were great for testing, but this one builds a RegEx from your Index data. Very helpful, thanks!

0 Karma


My favourite is: http://www.rubular.com

Fast and interactive

Path Finder

This is online tool: http://www.regexr.com/
This is cool interactive tutorial: http://regexone.com/ (20 exercises)


I belive the best tool for the job is ;

regex101.com .

Simply superb!!


If you like Regex101 (and I do), but cannot reach it from a customer site or are concerned about sending private data to the internet you can run it offline using a trick from https://github.com/Syskaw/Regex101.com-offline-app/blob/master/runLocalRegex101.sh

Revered Legend

The Field Extractor app is useful sometimes. Have a look.



There are tools available where you can test your created regex. They also provide short documentation for the most common regex tokens. For example here: link

Also Splunk on his own has the ability to create a regex expression based on examples. Read more here: link


I think that it is more a Stack Overflow question, it isn't so much related to Splunk 🙂

BTW, you can take a look here: http://www.txt2re.com/index.php3

Get Updates on the Splunk Community!

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...

New Learning Videos on Topics Most Requested by You! Plus This Month’s New Splunk ...

Splunk Lantern is a customer success center that provides advice from Splunk experts on valuable data ...

How I Instrumented a Rust Application Without Knowing Rust

As a technical writer, I often have to edit or create code snippets for Splunk's distributions of ...