Splunk Search

'BuildInfo' field as "ABCYYYY_Number|XYZ" for eg "ABC2020_17|XYZ. Compare "error1" in consecutive  "BuildInfo"

VS0909
Communicator

I have 'BuildInfo' field as "ABCYYYY_Number|XYZ" for eg "ABC2020_17|XYZ. 

Number will be keep increasing for a year( like 1, 2, 3, 4.....) . For next year the Number will again reset to 1 and then keep increasing. "ABC2021_1|XYZ"

I want to compare "error1" in consecutive  "BuildInfo" . Please help

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It is not entirely clear what you are after. if you want to remove the year and build number from the field so that you can then group by build name then do something like this

| rex field=BuildInfo mode=sed "s/\d{4}_\d+|/|/g"

You can probably then use _time to order your log entries. If you still need the BuildInfo, then copy it to another field and edit that

If you need the year and build number extracted as a number so you can do numerical ordering (2020_1, 2020_2, ...2020_9, 2020_10, ...) rather than lexicographical ordering (2020_1, 2020_10, 2020_2, ...) then you could try something like this

| rex field=BuildInfo "\w+(?<year>\d{4})_(?<build>\d+)|"
| eval combined=(tonumber(year) * 1000) + tonumber(build)

 This assumes you don't have 1000+ builds per year. You could also probably just use the last two digits of the year if you like.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...