Getting Data In

How to remove all words in an event except for certain ones and put them in a table?

lonelyknight
Observer

I have a event like this

02.09.2022; seller david address 434 xyz house price 20000  [color:green] {noffloors: 5] status sold

02.09.2022; seller lenin address 222 abc  house price 30000  [color:red] {noffloors: 7] status sold

Assuming address, price, color and noffloor are not indexed as fields. How do I obtain output like this ? I am thinking of using regex but i dnt know the exact experssion

address     price      color      nofloor

434 zyz    20000   green      5

222 abc    30000  red            7

 

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

This rex statement will extract the data based on your example events

| rex "address (?<address>.*) house price (?<price>\d+)\s+\[color:(?<color>[^\]]*)\]\s+\{noffloors:\s(?<noffloors>\d+)"

 but it's pretty rigid in that all fields must be in that format/order

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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