Security

I need to extract field call "subject" from data field "FW: [ DOC 45 ] DTP: DEMO XXX CCC | 20147"

karu0711
Communicator

Data field  "FW: [ DOC 45 ] DTP: DEMO XXX CCC | 20147" from this I need to extract  "DEMO XXX CCC"

output subject field "DEMO XXX CCC"

0 Karma

Gr0und_Z3r0
Contributor

@karu0711 

| makeresults
| eval a="FW: [ DOC 45 ] DTP: DEMO XXX CCC | 20147"
| eval subject=mvindex(split(mvindex(split(a,":"),2),"|"),0)

 

Gr0und_Z3r0_0-1679998854603.png

 

 

ITWhisperer
SplunkTrust
SplunkTrust

Based on other answers you have been given to similar questions, what have you tried so far?

karu0711
Communicator

I need to create separate so I can count and create dropdown to search.
  DEMO XXX CCC

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

OK So, from what you have been shown with rex already, how do you think this could be applied to your current request. Note that regex.com is a good site for creating and testing regex extractions (although they can need a bit of tweaking to use in Splunk, especially if back-slashes are involved).

Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...