script
Description
Executes a script and appends the results to the query.
warning
To use the script source, a configured SM Script Proxy connector is required.
Syntax
...| script [intr=<script_interpreter>] <script_file_name>
Required Arguments
Parameter | Syntax | Description |
---|---|---|
script_file_name | <string> | Name of the script file. |
Optional Arguments
Parameter | Syntax | Default | Description |
---|---|---|---|
script_interpreter | <string> | Taken from sme.core.remote_script.base_interpreter_name . | Name of the interpreter. |
Source Configuration
info
All source settings are stored in _cluster/settings
.
Example settings:
"sme" : {
"core" : {
"remote_script" : {
"base_path" : "/home/test_user/test/",
"port" : "18080",
"base_interpreter_name" : "python3",
"url" : "http://localhost",
"interpreters" : [
"python3::/usr/bin/python3",
"bash::/usr/bin/bash"
]
}
}
}
Configuration Parameter Descriptions
url
— the URL of the SM Script Proxy connectorport
— the port for the SM Script Proxy connectorinterpreters
— names of the interpreters and paths to their executable filesbase_interpreter_name
— the default interpreter namebase_path
— the path to the directory where the scripts are located
Query Examples
Example #1
| script test-script.py
Example #2
source tweets
| script intr=python3 test-script.py