Mahith Geallapally
Mahith Geallapally

Reputation: 21

Grok Pattern escaping a - (hyphen)

I want to write a grok pattern for something like 123-543, which is two numbers separated by a hyphen. I've written a grok %{NUMBER:num1}-%{NUMBER:num2} by escaping the hyphen but it's not working. Alsi attached a screenshot by testing it on a online grok debugger. Can someone help me? enter image description here

Upvotes: 0

Views: 1274

Answers (1)

Sourav
Sourav

Reputation: 3392

Please find the grok pattern here:

%{INT:num1}\-%{INT:num2}

Output:

enter image description here

Upvotes: 1

Related Questions