Splunk Search

How to give each field Additional Information and use this in a search query

cmak
Contributor

I have a bunch of fields, let's say Field A, Field B, Field C.

I want to give each field a certain value.
For example, Field A has value of 2
Field B has value of 1
Field C has value of 2

How should I give Splunk this information?
Should it be in a separate lookup table or just in an addional row in my CSV file?

If so, how can I search and only show fields with a certain value

Tags (1)
0 Karma

cmak
Contributor

I have many Fields

Field A, FieldB, Field C, Field D
They each have a weight associated with them.
FieldA : 0
FieldB : 1
FieldC : 0
FieldD : 1

I tried using a lookup table to associate the field with a weight but I cannot seem to be able to do so.

I would like to do queries like:
Just show the fields in the table with weight of 0.
Then only Field A and Field C would show.

0 Karma

Drainy
Champion

I'm going to take a punt and say you're after an automatic lookup, what you mean by "an additional row in my CSV file?" is a bit beyond us as you haven't mentioned an existing CSV file 😉

In this case I would put it into a lookup such as;

values.csv  
    Field, Value
    A,2
    B,1
    C,2

I would then create an automatic lookup in my props.conf for that sourcetype;

[MYAMAZINGSOURCETYPE]
LOOKUP-values = valuescsv Field OUTPUT Value

In transforms.conf I would define the lookup...

[valuescsv]
filename = values.csv

Finally, you need to take into consideration how the Field value is extracted, presumably this is already handled in your instance but you need to make sure that is extracted BEFORE the automatic lookup.

Otherwise, you can now run a search on that sourcetype for a Value=2 to only see those values.

Ayn
Legend

There are multiple options, and what suits you depends entirely on what specifically you're trying to do. Could you explain your scenario more in detail?

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