Splunk Search

CSV data is not matching with my indexed data

raby1996
Path Finder

Hi all,

Thank you

0 Karma
1 Solution

masonmorales
Influencer

You might be capturing leading whitespace in your capture group with the \s+ in rex "(?\s+\d+\.\d+\.\d+\.\d+)" which could cause it to not match if there isn't leading whitespace in your lookup. If you remove the \s+ from your extraction, does it help?

View solution in original post

masonmorales
Influencer

You might be capturing leading whitespace in your capture group with the \s+ in rex "(?\s+\d+\.\d+\.\d+\.\d+)" which could cause it to not match if there isn't leading whitespace in your lookup. If you remove the \s+ from your extraction, does it help?

masonmorales
Influencer

You could try setting match_type = WILDCARD("Bundle Version") in transforms.conf. It may require a restart of Splunk after though, and no guarantee that it will work as I've seen a documented bug on Splunk not ignoring leading whitespace when it's supposed to. Worth a try though...

Docs: http://docs.splunk.com/Documentation/Splunk/6.2.5/admin/Transformsconf

match_type =
* A comma and space-delimited list of () specification to allow for non-exact matching
* The available match_type values are WILDCARD, CIDR, and EXACT. EXACT is the default and does not need to be specified. Only fields that should use WILDCARD or CIDR matching should be specified in this list

On a side note, I would try to avoid using spaces in field names - both in lookups and in event field names. If you use an underscore (_) instead of space, it'll save you a lot of headache. If you're trying to make it look nice for users, use a rename at the very end of your search, i.e. ....entire search.... | rename myfield as "My Field", myotherfield as "My Other Field" etc.

0 Karma

raby1996
Path Finder

Great Thank you!

0 Karma

raby1996
Path Finder

Yes that was the problem thank you very much, by chance, would you happen to know if there is a way that i can still capture the rex pattern for my Bundle with the white space ( if i omit it i get the wrong code) but only compare the parts after?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

How about this

index=* sourcetype=collectedCodeLevels.All "HMC Code Levels"   
 | rex "(?<Bundle>\s+\d+\.\d+\.\d+\.\d+)" | search [ | inputlookup Report_lookup.csv  | table "Bundle Version"  | rename "Bundle Version" as "Bundle" ]
0 Karma

raby1996
Path Finder

Hmmmm that doesn't seem to work either, do you think it might be that the lookup table is configured wrong?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

WIth the approach I gave, I don't think you need special configuration for that. Can you confirm if the values and its format in the lookup table matches the one you're extracting in your data?

Also, from the search I gave, open the job inspector and check the normalizedSearch that is being run.

0 Karma

raby1996
Path Finder

Yes I checked and there are fields of the same value on both sides, also normalizedSearch is being ran.

0 Karma

raby1996
Path Finder

Am i going to have to this from the server?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

can you provide the normalizedSearch that you see (mask sensitive information).

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...