Skip to main content

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

ParameterSyntaxDescription
script_file_name<string>Name of the script file.

Optional Arguments

ParameterSyntaxDefaultDescription
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 connector
  • port — the port for the SM Script Proxy connector
  • interpreters — names of the interpreters and paths to their executable files
  • base_interpreter_name — the default interpreter name
  • base_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