Splunk Search

How do I extract this field from my sample data?

splgeek
Explorer

I want to extract the PHP Message as a field so I can have all the various php error messages:

2016/10/20 21:23:18 [error] 26550#26550: *9254611 FastCGI sent in stderr: "PHP message: PHP Warning:  trim() expects parameter 1 to be string, array given in /var/www/html/xx/xxxx-xx.xxxx.xxx.com/wordpress/wp-includes/option.php on line 247" while reading response header from upstream, client: 0.0.0.00, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://000.0.0.1:9000", host: "xxx.xx.com"
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Give this a try

your base search | rex "PHP message\: (?<PHPError>[^\"]+)"

View solution in original post

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Give this a try

your base search | rex "PHP message\: (?<PHPError>[^\"]+)"
0 Karma

splgeek
Explorer

thanks
that did work
so this could not have been possible with the IFX right?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

I think it would. Be sure to select the whole string that you want to extract OR you can specify your own regex (this one) in the IFX to save it.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...