Splunk Search

combine two evals in to a single case statement

codedtech
Path Finder

I have 1600+ storage arrays and they are from multiple vendors, each with different thin provisioning levels. I currently have two columns one called TP at 1.2 and one called TP at 1.5. I'd like to combine them into a single column. I tried an if statement, but I couldn't get it right, I'm thinking I need to use a case statement but I'm not sure.  Here is an example

eval "Thin Prov"=Case(((SV='vendorA' AND SM='MODEL1' OR SM='Model2'),(TC*1.5), (SV='vendorb' AND SM='Model3' or SM='Model4',TC*1.2))

Labels (1)
Tags (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If column "TP at 1.2" and "TP at 1.5" are mutually exclusive i.e if "TP at 1.2" has a value then "TP at 1.5" is null and vice versa then try:

| eval "Thin Prov"=if(isnull('TP at 1.2'),"TC*1.5","TC*1.2")

  

0 Karma

codedtech
Path Finder

@ITWhisperer unfortunately they are not mutually exclusive.  I was thinking something like this should work but I can't seem to get it right.

eval TP=case(((storage-model="A" OR storage-model="B"), (TCap*1.5)-LProv))

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You have too many brackets

eval TP=case((storage-model="A" OR storage-model="B"), (TCap*1.5)-LProv, condition2, value2, etc, etc)
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

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