Hi,
I have an execbeat to call a shellscript, and it works fine. In the shell script, I have modifies it to accept arguments like $1
, $2
etc. So, inorder to execute my script, we need to run it in bash like;
sh myscript.sh arg1 arg2
But, when I used it with execbeat, I am getting an error like;
{
"@timestamp": "2017-02-20T08:38:34.000Z",
"beat": {
"hostname": "mypc",
"name": "mybeat",
"version": "2.1.1"
},
"exec": {
"command": "sh",
"stderr": "sh: /shellscripts/myscript.sh arga argb: No such file or directory\n",
"stdout": ""
},
"fields": {
"beatname": "beat1",
"host": "192.168.0.1"
},
"type": "execbeat"
}
below is my configuration
execbeat:
execs:
-
cron: "@every 5s"
command: sh
args: "/shellscripts/myscript.sh arga argb"
document_type: execbeat
fields:
host: 192.168.0.1
beatname: "beat1"
output.console:
enabled: true
pretty: true
Inside the directory shellscripts
, I am able to execute sh myscript.sh arga argb
and it works fine. Why is this happening and how can I fix this?
Thanks in advance.