In splunk NIX TA they have used a script named iostat.sh. In the script the command got used is iostat -xk 1 2 i.e. it is providing the IO statistics extensively and running in every 1 sec for 2 times. Now when I am running this particular command in my linux server it is providing me the r/s and rkB/s value as 0.00 in every 2nd second whether it has some value in the first second.
So whenever I am trying to retrieve the data for sourcetype=iostat it is showing me r/s and rKB/s as 0.00.
Why the data is 0.00 in every 2nd second??? Is there any thing that I am missing???
I have found out the answer. in the iostat.sh they are using the command iostat -xk 1 2 because it wants to run the script for two times in a interval of 1 sec. The first result shows from the last time the server got restarted and the second result shows the data for now.
For me I was getting the r/s and rKB/s values are 0 because all the data reading were taking place in the cache.