Splunk Search

How to extract a multiline "User-Agent" field from my data?

dongeui_hong
New Member
S,login.test.com,HTTPS,,2016-07-27T06:41:43.000Z,,iPad,0,,login.test.com,,1469601703,NA,PROD-150607-to-as-edgenode-3,N,"{""cpu"":""NA"",""cpu_bus"":"""",""toolbar"":""""}",,mobile,0,,1.1,,"Host: login.test.com
User-Agent: Mozilla/5.0 (iPad; CPU OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12F69 Safari/i-filter/ios
Content-Type: application/x-www-form-urlencoded
Referer: https://login.test.com/auwallet/action/ss111A/W111A 11Action/RW111A1156
Via: 1.1 h0-s234.p34-kix.cdngp.net apach/8.1.38, 1.1 h0-s112.p21-nrt.cdngp.net apache/8.1.38
X-Forwarded-For: 106.0.11.7, 14.0.41.130, 14.0.35.143
X-Forwarded-IP: 106.0.11.7
X-Initial-Url: https://login.test.com/auwallet/action/ss111A/W111A11Action/RW111A1141
X-SESSION-ID: Mjk4MzoxNDY5NjAxNzAyOTk3OjEwNzM0
X-User-IP-Port: 106.186.201.7:62923
Accept-Encoding: gzip, deflate
Proxy-Connection: keep-alive
Accept-Language: ja-jp
Origin: https://login.test.com
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Length: 490
X-Forwarded-Proto: https
X-FB-SSL: on

",N,/var/log/edgenode/edgenode_v10.log,NA,IPS,POST,200,106.186.201.7,,orange NW,NA,c75139c390c894d7da51d3761215b494,,120064994,test CORPORATION,NA,,,1,d118d507dc7e731d2b986967882b7914-4-0-0-0,NA,,,,,/auwallet/action/ss111A/W111A11Action/RW111A1141,be6f66140b11d6af114106c1f5b93786,text/html,AppleWebKit,monitor,JP,allow,0,275190,

I want to extract User-Agent
How to do I do?

0 Karma
1 Solution

sundareshr
Legend

If you want to extract in SPL or IFX, use this regex

... | rex "User-Agent:(?<UA>[^\t\n\r]+)"

View solution in original post

sundareshr
Legend

If you want to extract in SPL or IFX, use this regex

... | rex "User-Agent:(?<UA>[^\t\n\r]+)"

dongeui_hong
New Member

Thanks ~~~
solved.

0 Karma
Get Updates on the Splunk Community!

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

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...

Edge Processor Scaling, Energy & Manufacturing Use Cases, and More New Articles on ...

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

Get More Out of Your Security Practice With a SIEM

Get More Out of Your Security Practice With a SIEMWednesday, July 31, 2024  |  11AM PT / 2PM ETREGISTER ...