Splunk Search

using field name in like command

smuderasi
Explorer

host=dummy | eval Pattern='arb_usg_mps%06' | where like (source,'%Pattern%')
doesnot work . can you help what's wrong in this? But events do exists.

Tags (1)
0 Karma
1 Solution

woodcock
Esteemed Legend

This should work (you had extra spaces and other small problems)

| makeresults | eval source="fooarb_usg_mpsbar06foobar::fooarb_usg_mpsbar07foobar"
| makemv delim="::" source
| mvexpand source

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| eval Pattern="%arb_usg_mps%06%"
| where like(source, Pattern)

View solution in original post

woodcock
Esteemed Legend

This should work (you had extra spaces and other small problems)

| makeresults | eval source="fooarb_usg_mpsbar06foobar::fooarb_usg_mpsbar07foobar"
| makemv delim="::" source
| mvexpand source

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| eval Pattern="%arb_usg_mps%06%"
| where like(source, Pattern)

smuderasi
Explorer

Thanks it worked:)

0 Karma
Get Updates on the Splunk Community!

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 ...

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...