Splunk Search

how to extract a field from the results of a search query.

pratapa
Explorer

Some events generated from the below search query.

index=webmethods_nonprd CESAP.pub.Shipment.handler:processShipment_PostalMailProvider OR CEAustraliaPost.sub.Shipment.handler | transaction shipment | search NOT (linecount="3" AND "Published shipment document" AND "Successfully created Australia Post shipment order" "Generated Australia Post shipment order summary and archived it in the SAP content repository")

We would like to extract the field "shipping point" from the results of the above search query.

Please let us know how to modify the above search query to extract the field "shipping point".

0 Karma

begleyj1
Path Finder

It depends on your results. Take a look at the doc here for guided assistance with extracting fields: https://docs.splunk.com/Documentation/Splunk/7.3.2/Knowledge/ExtractfieldsinteractivelywithIFX

0 Karma

pratapa
Explorer

For example :

How to extract the value 7020 from the below field "shipping point" and assign it to a variable shipping_point

shipping point="7020"

0 Karma

anthonymelita
Contributor

You need to provide an example of what the returned event data looks like. With an accurately formatted example, someone can assist you with regex. Or if you already know regex, look up documentation for the "| rex" command. Generic example would be like:
| rex field=_raw "(something\sbefore)(?<shipping point>\d{4})"

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...