Splunk Search

Field Extraction help!!

splunker9999
Path Finder

Hi ,

We have sample data like below and need to extract these fields:
"GB*2" with field value as "NC-MEDICAL" and "GI*" as "NC-Medical"

****20150816*1603*34578*X*1879642~ST*270*000000001*1879642~BHT*0022*13*PHX*20150816*1603~LG*120*1~NM1******GB*2*NC-MEDICAL***GI*NC-MEDICAL*****

Can someone please help us with field extraction?

Thanks
Sarath

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

This regular expression will extract those fields.

"GB\*2\*(?<GB2>[^\*]+)\*\*GI\*(?<GI>[^\*]+)"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This regular expression will extract those fields.

"GB\*2\*(?<GB2>[^\*]+)\*\*GI\*(?<GI>[^\*]+)"
---
If this reply helps you, Karma would be appreciated.
0 Karma

splunker9999
Path Finder

Thank you , this works.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

Data Management Digest – May 2026

Welcome to the May 2026 edition of Data Management Digest!   As your trusted partner in data innovation, the ...