Is there a way in which i can save the data from metric beat even though the output destination is not available?
Like for example elasticsearch host can't be reach, it will save first the data then continue once the connections is available again.
Or are the any third party application which I can store the pending data of metric beat?
It works on my machine using 6.3.1, but I'm not on Windows. After learning that you are using Windows I am surprised to see that file permission error because AFAIK windows does not use POSIX permissions like show in the error, but has a DACL.
Can you try a workaround by adding permissions: 0777.
2018-08-03T11:53:47.570+0800 ERROR instance/beat.go:691 Exiting: error initializing publisher: spool queue: failed to open file at path 'C:\ProgramData\metricbeat/spool.dat': file C:\ProgramData\metricbeat/spool.dat can not be locked right now
Sorry, it looks like you worked around the problem only to hit another one. The spooling to disk feature is still marked as beta. Can you please open a new issue on Github for the last error you hit and we'll get it fixed. I'm quite sure it's some kind of bug specific to Windows.