Splunk Search

Need to split string at last character before numeric value.

JayWest
New Member

So i have a possibly unique requirement, i'm trying to split up so log data but i have a string in one field that contains numerous peices of information both numeric and character based. The numeric fields are of fixed length which i'm able to split without isssue BUT in the string there is also a character value (persons name). Now the issue i have is that the name part of the string is not fixed length it's based on the name length so doing a split by character number is not going to produce the results.

What i wanted to ask is, Is it possible to split a string between the end of a character value and a numeric one, example would be:

From this:

** Update **

I think it may be best to post a string that is more inline to what i want to do.

So the current field data i have looks like this:

1234567801D52411021103100001860000CF19John Doe01D5232102110265000159000001D5231202110265000103400601D53324021103100000000005

Single string but in this string is multiple pieces of information. What i want to do is extract the Name (John Doe) and use the values that remains as they are of ixed length. My problem is with removing the name as that is variable length and makes it hard to split. 

Thanks in advance.

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex field=Field1 "(?<Field1>\D+)(?<Field2>\d+)"
0 Karma

JayWest
New Member

Thanks for the suggesting, i just tried it and didn't work out for me, i have updated my post with a full string example which may help understand what i am trying to achieve.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Thanks, often better to use real or close to real examples rather than waste everyone's time with inaccurate fake examples.. Try this (although I suspect even this isn't wholly accurate, but you'll get the idea!)

| rex field=Field1 "(?<Field1>.{38})(?<Field2>.+)(?<Field3>.{78})"

 

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!

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

How to find the worst searches in your Splunk environment and how to fix them

Everyone knows Splunk is a powerful platform for running searches and doing data analytics. Your ...

Share Your Feedback: On Admin Config Service (ACS)!

Help Us Build a Better Admin Config Service Experience (ACS)   We Want Your Feedback on Admin Config Service ...