Splunk Search

extract field for below mentioned log

vikram_m
Path Finder

From the log mentioned below I need to extract the field 'Response Time' and then frame a query for response time < 10sec

2017-06-19 10:29:25,556 [[weather-project-v1-dev-corp].api-httpListenerConfig.worker.01] INFO org.mule.api.processor.LoggerMessageProcessor - Transaction [4610f1e7c84641f7ac851ea04d0e4e7b] - Response Time [0.404325574999973] - HTTP Status [200] - Returned Success Response to Client

Can some one please suggest how can I add "Response time" to interesting fields and then I can use it for framing queries accordingly.

Thanks.
Vikram.

0 Karma
1 Solution

afurrow
New Member

in your props.conf:

EXTRACT-ResponseTimeMS = (Response Time \[)(?<ResponseTimeMS>[0-9]*\.[0-9]*)(\])

in your query, maybe use a case statement:

|eval ResponseSpeedType=case(ResponseTimeMS<10, "UnderTen", ResponseTimeMS>10, "OverTen", True(), "DefaultForEverythingElse")
0 Karma

niketn
Legend

You can start with rex. However, Use Splunk's Interactive Field Extraction to let Splunk generate Regular Expression based on your data sample. (https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX)

<YourBaseSearch>
| rex field=_raw "Response Time \[(?<ResponseTime>[^\]]+)\]"
| where ResponseTime <10
| table _time ResponseTime _raw

Looking at your data unless you have already done so, you should also create extractions for Transaction ID and HTTP Status code to come up with more meaningful data transformations.
If you test out above Regular Expression with your data you should consider creating Field Extraction for the same so that the Field persists as a Knowledge Object.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

vikram_m
Path Finder
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...