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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...