O'Reilly logo

Splunk 7 Essentials - Third Edition by Betsy Page Sigman, Erickson Delgado, J-P Contreras

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an attribute based on a regular expression

Now, we are going to create an attribute based on a regular expression, which is a specialized text string that describes a search pattern. What we want to do is extract the airport code that is part of the Destination Details URI:

http_uri="/destination/MIA/details" 

To do this, we have to create an attribute in the Destination Details child. Follow these steps:

  1. Select Destination Details, click on the Add Field dropdown, and select Regular Expression.
  2. In the Regular Expression field, type in the following text:
/destination/(?<AirportCode>.+?)/details 
  1. Click on the blank area outside the text box to populate the field, as shown in the following screenshot.
  2. Change the display name to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required