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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...