Hello
in the request below, i try to calculate a trend between 2 report
but i try to do this :
- if the data of a report is the same in anothr report, the result is 100% but i want 0% in this case
- if the value of the first report is > to the value of the second report then i want to divise value 2 by value 1
- if the value of the second report is > to the value of the first report then i want to divise value 1 by value 2
Could you help me please??
index="windows-wmi" sourcetype="wmi:DiskRAMLoad" Name="mfetp.exe"
| head 10
| stats avg(ReadOperationCount) as mfetp_ReadOperation_AVG, avg(ReadTransferCount) as mfetp_ReadTransfer_AVG, avg(WriteOperationCount) as mfetp_WriteOperation_AVG, avg(WriteTransferCount) as mfetp_WriteTransfer_AVG
| appendcols
[ search index="windows-wmi" sourcetype="wmi:DiskRAMLoad" Name="mfetp.exe"
| head 10
| stats avg(ReadOperationCount) as mfetp_ReadOperation_AVG2, avg(ReadTransferCount) as mfetp_ReadTransfer_AVG2, avg(WriteOperationCount) as mfetp_WriteOperation_AVG2, avg(WriteTransferCount) as mfetp_WriteTransfer_AVG2 BY host]
| eval percReadOperation_AVG=round((mfetp_ReadOperation_AVG/mfetp_ReadOperation_AVG2)*100,2),
percReadTransfer_AVG=round((mfetp_ReadTransfer_AVG/mfetp_ReadTransfer_AVG2)*100,2),
percWriteOperation_AVG=round((mfetp_WriteOperation_AVG/mfetp_WriteOperation_AVG2)*100,2),
percWriteTransfer_AVG=round((mfetp_WriteTransfer_AVG/mfetp_WriteTransfer_AVG2)*100,2) | table percReadOperation_AVG percReadTransfer_AVG percWriteOperation_AVG percWriteTransfer_AVG
Give this a try
index="windows-wmi" sourcetype="wmi:DiskRAMLoad" Name="mfetp.exe"
| head 10
| stats avg(ReadOperationCount) as mfetp_ReadOperation_AVG, avg(ReadTransferCount) as mfetp_ReadTransfer_AVG, avg(WriteOperationCount) as mfetp_WriteOperation_AVG, avg(WriteTransferCount) as mfetp_WriteTransfer_AVG
| appendcols
[ search index="windows-wmi" sourcetype="wmi:DiskRAMLoad" Name="mfetp.exe"
| head 10
| stats avg(ReadOperationCount) as mfetp_ReadOperation_AVG2, avg(ReadTransferCount) as mfetp_ReadTransfer_AVG2, avg(WriteOperationCount) as mfetp_WriteOperation_AVG2, avg(WriteTransferCount) as mfetp_WriteTransfer_AVG2 BY host]
| foreach mfetp_*_AVG [| eval perc<<MATCHSTR>>_AVG=case('<<FIELD>>'=='<<FIELD>>2',0, '<<FIELD>>'>'<<FIELD>>2', round(('<<FIELD>>'/'<<FIELD>>2')*100,2), true(), round(('<<FIELD>>2'/'<<FIELD>>')*100,2))]
| table percReadOperation_AVG percReadTransfer_AVG percWriteOperation_AVG percWriteTransfer_AVG
Give this a try
index="windows-wmi" sourcetype="wmi:DiskRAMLoad" Name="mfetp.exe"
| head 10
| stats avg(ReadOperationCount) as mfetp_ReadOperation_AVG, avg(ReadTransferCount) as mfetp_ReadTransfer_AVG, avg(WriteOperationCount) as mfetp_WriteOperation_AVG, avg(WriteTransferCount) as mfetp_WriteTransfer_AVG
| appendcols
[ search index="windows-wmi" sourcetype="wmi:DiskRAMLoad" Name="mfetp.exe"
| head 10
| stats avg(ReadOperationCount) as mfetp_ReadOperation_AVG2, avg(ReadTransferCount) as mfetp_ReadTransfer_AVG2, avg(WriteOperationCount) as mfetp_WriteOperation_AVG2, avg(WriteTransferCount) as mfetp_WriteTransfer_AVG2 BY host]
| foreach mfetp_*_AVG [| eval perc<<MATCHSTR>>_AVG=case('<<FIELD>>'=='<<FIELD>>2',0, '<<FIELD>>'>'<<FIELD>>2', round(('<<FIELD>>'/'<<FIELD>>2')*100,2), true(), round(('<<FIELD>>2'/'<<FIELD>>')*100,2))]
| table percReadOperation_AVG percReadTransfer_AVG percWriteOperation_AVG percWriteTransfer_AVG
hello
i just want another thing please
in the result of the percentage, i want to display for example + OR -
+ when result of value 2 > result of value 1
- when result of value 1 > result of value 2
Could you do this please??
OH WONDEFUL! thanks a lot