I have a series of eval statements that I'd like to call from multiple dashboards, but have it coded in only one place for ease of maintenance. Below are the statements I need that do calculations differently based on the date. What's the best way to accomplish this?
| eval timecheck=substr(DATETIME,1,10) | eval current_epoch = strptime(timecheck,"%Y-%m-%d")
| eval Upgrade_Date=strptime("2017-01-22","%Y-%m-%d") <!-- Date of CPU Upgrade -->
| eval current_mips = if(current_epoch>=Upgrade_Date,3322,3400) <!-- NewMIPS,OldMIPS -->
| eval current_cps = if(current_epoch>=Upgrade_Date,5400,4500) <!-- NewCPs,OldCPs -->
| eval MipsGP = cpusecs / current_cps *current_mips <!-- GP secs / gpMips * secs avail -->
| eval MipsGP=round(MipsGP,1)
... View more