<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [Error] Pass token values from a dashboard as parameters to python script in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677077#M55437</link>
    <description>&lt;P&gt;It's not that because in the search log we saw that the $technique_id$ is well pass (T1059.003)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;02-09-2024 10:37:46.161 INFO  SearchParser [10449 searchOrchestrator] - PARSING: | makeresults | eval technique_id="T1059.003" | where isnotnull(technique_id) | mitrepurplelab T1059.003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And even when i'm doing this command, I have the same issue :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mitrepurplelab T1059.003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the issue is with the&amp;nbsp;commands.conf&lt;/P&gt;&lt;P&gt;When i put&amp;nbsp;command.arg.1 = $technique_id$ on the commands.conf the script try to run with&amp;nbsp;$technique_id$ as an argument but literraly&amp;nbsp;$technique_id$ not 1059.003 so It doesn't work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2024 13:05:11 GMT</pubDate>
    <dc:creator>mcayrol</dc:creator>
    <dc:date>2024-02-09T13:05:11Z</dc:date>
    <item>
      <title>[Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677064#M55429</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I created a dashbord with a text input, the token is then passed to a panel that executes this command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;query&amp;gt;| makeresults | eval technique_id="$technique_id$" | where isnotnull(technique_id) | mitrepurplelab $technique_id$&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;the purpose of this command is to trigger a custom command with this config:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[mitrepurplelab]
filename = mitrepurplelab.py
enableheader = true
outputheader = true
requires_srinfo = true
chunked = true
streaming = true&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the mitrepurplelab.py script is then triggered, here is its code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys
import requests
import logging

logging.basicConfig(filename='mitrepurplelab.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
def main():
logging.debug(f "Arguments received: {sys.argv}")
if len(sys.argv) != 2:
logging.error("Incorrect usage: python script.py &amp;lt;technique_id&amp;gt;")
print("Usage: python script.py &amp;lt;technique_id&amp;gt;")
return

technique_id = sys.argv[1]
url = "http://192.168.142.146:5000/api/mitre_attack_execution"

# Make sure your JWT token is complete and correctly formatted
token = "token
headers = {
"Authorization": f "Bearer {token}"
}
params = {
"technique_id": technique_id
}

response = requests.post(url, headers=headers, params=params)

if response.status_code == 200:
print("Request successful!")
print("Server response:")
print(response.json())

else:
logging.error(f "Error: {response.status_code}, Response body: {response.text}")
print(f "Error: {response.status_code}, Response body: {response.text}")

if __name__ == "__main__":
main()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the script works well when run by hand, for example :&lt;/P&gt;&lt;P&gt;python3 bin/mitrepurplelab.py T1059.003&lt;/P&gt;&lt;P&gt;but when I execute it via the dashboard I get this error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/29322i9D2FE495DC7B7DCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="splunk.png" alt="splunk.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in the panel search.log I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;02-09-2024 10:37:46.075 INFO  dispatchRunner [1626 MainThread] - Search process mode: preforked (reused process by new user) (build 1fff88043d5f).
02-09-2024 10:37:46.075 INFO  dispatchRunner [1626 MainThread] - registering build time modules, count=1
02-09-2024 10:37:46.075 INFO  dispatchRunner [1626 MainThread] - registering search time components of build time module name=vix
02-09-2024 10:37:46.076 INFO  BundlesSetup [1626 MainThread] - Setup stats for /opt/splunk/etc: wallclock_elapsed_msec=7, cpu_time_used=0.00727909, shared_services_generation=2, shared_services_population=1
02-09-2024 10:37:46.080 INFO  UserManagerPro [1626 MainThread] - Load authentication: forcing roles="admin, power, user"
02-09-2024 10:37:46.080 INFO  UserManager [10446 RunDispatch] - Setting user context: splunk-system-user
02-09-2024 10:37:46.080 INFO  UserManager [10446 RunDispatch] - Done setting user context: NULL -&amp;gt; splunk-system-user
02-09-2024 10:37:46.080 INFO  UserManager [10446 RunDispatch] - Unwound user context: splunk-system-user -&amp;gt; NULL
02-09-2024 10:37:46.080 INFO  UserManager [10446 RunDispatch] - Setting user context: admin
02-09-2024 10:37:46.080 INFO  UserManager [10446 RunDispatch] - Done setting user context: NULL -&amp;gt; admin
02-09-2024 10:37:46.080 INFO  dispatchRunner [10446 RunDispatch] - search context: user="admin", app="Ta-Purplelab", bs-pathname="/opt/splunk/etc"
02-09-2024 10:37:46.080 INFO  SearchParser [10446 RunDispatch] - PARSING: | makeresults | eval technique_id="T1059.003" | where isnotnull(technique_id) | mitrepurplelab T1059.003
02-09-2024 10:37:46.081 INFO  dispatchRunner [10446 RunDispatch] - Search running in non-clustered mode
02-09-2024 10:37:46.081 INFO  dispatchRunner [10446 RunDispatch] - SearchHeadInitSearchMs=0
02-09-2024 10:37:46.081 INFO  dispatchRunner [10446 RunDispatch] - Executing the Search orchestrator and iterator model (dfs=false).
02-09-2024 10:37:46.081 INFO  SearchOrchestrator [10446 RunDispatch] - SearchOrchestrator is constructed.  sid=admin__admin_VGEtUHVycGxlbGFi__search1_1707475066.37, eval_only=0
02-09-2024 10:37:46.081 INFO  SearchOrchestrator [10446 RunDispatch] -  Initialized the SRI
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Initializing feature flags from config. feature_seed=2135385444
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=parallelreduce:enablePreview:true
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=search:search_retry:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=search:search_retry_realtime:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=parallelreduce:autoAppliedPercentage:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=subsearch:enableConcurrentPipelineProcessing:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=subsearch:concurrent_pipeline_adhoc:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=append:support_multiple_data_sources:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=join:support_multiple_data_sources:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=search_optimization::set_required_fields:stats:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=searchresults:srs2:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=search:read_final_results_from_timeliner:true
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=search:fetch_remote_search_telemetry:true
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=testing:boolean_flag:false
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=testing:percent_flag:true
02-09-2024 10:37:46.081 INFO  SearchFeatureFlags [10446 RunDispatch] - Setting feature_flag=testing:legacy_flag:true
02-09-2024 10:37:46.081 INFO  SearchOrchestrator [10446 RunDispatch] - Search feature_flags={"v":1,"enabledFeatures":["parallelreduce:enablePreview","search:read_final_results_from_timeliner","search:fetch_remote_search_telemetry","testing:percent_flag","testing:legacy_flag"],"disabledFeatures":["search:search_retry","search:search_retry_realtime","parallelreduce:autoAppliedPercentage","subsearch:enableConcurrentPipelineProcessing","subsearch:concurrent_pipeline_adhoc","append:support_multiple_data_sources","join:support_multiple_data_sources","search_optimization::set_required_fields:stats","searchresults:srs2","testing:boolean_flag"]}
02-09-2024 10:37:46.081 INFO  ISplunkDispatch [10446 RunDispatch] - Not running in splunkd. Bundle replication not triggered.
02-09-2024 10:37:46.081 INFO  SearchOrchestrator [10449 searchOrchestrator] - Initialzing the run time settings for the orchestrator.
02-09-2024 10:37:46.081 INFO  UserManager [10449 searchOrchestrator] - Setting user context: admin
02-09-2024 10:37:46.081 INFO  UserManager [10449 searchOrchestrator] - Done setting user context: NULL -&amp;gt; admin
02-09-2024 10:37:46.081 INFO  AdaptiveSearchEngineSelector [10449 searchOrchestrator] - Search execution_plan=classic
02-09-2024 10:37:46.082 INFO  SearchOrchestrator [10449 searchOrchestrator] - Creating the search DAG.
02-09-2024 10:37:46.082 INFO  SearchParser [10449 searchOrchestrator] - PARSING: | makeresults | eval technique_id="T1059.003" | where isnotnull(technique_id) | mitrepurplelab T1059.003
02-09-2024 10:37:46.082 INFO  DispatchStorageManagerInfo [10449 searchOrchestrator] - Successfully created new dispatch directory for search job. sid=dc5edf3eebc8ccb6_tmp dispatch_dir=/opt/splunk/var/run/splunk/dispatch/dc5edf3eebc8ccb6_tmp
02-09-2024 10:37:46.082 INFO  SearchParser [10449 searchOrchestrator] - PARSING: premakeresults 
02-09-2024 10:37:46.082 INFO  DispatchThread [10449 searchOrchestrator] - BatchMode: allowBatchMode: 1, conf(1): 1, timeline/Status buckets(0):0, realtime(0):0, report pipe empty(0):0, reqTimeOrder(0):0, summarize(0):0, statefulStreaming(0):0
02-09-2024 10:37:46.082 INFO  DispatchThread [10449 searchOrchestrator] - required fields list to add to remote search = *
02-09-2024 10:37:46.082 INFO  DispatchCommandProcessor [10449 searchOrchestrator] - summaryHash=f2df6493ea859e37 summaryId=A6ADAC30-27EC-4F28-BEB9-3BD2C7EC3E53_Ta-Purplelab_admin_f2df6493ea859e37 remoteSearch=premakeresults 
02-09-2024 10:37:46.082 INFO  DispatchCommandProcessor [10449 searchOrchestrator] - summaryHash=NSf2df6493ea859e37 summaryId=A6ADAC30-27EC-4F28-BEB9-3BD2C7EC3E53_Ta-Purplelab_admin_NSf2df6493ea859e37 remoteSearch=premakeresults 
02-09-2024 10:37:46.082 INFO  DispatchThread [10449 searchOrchestrator] - Getting summary ID for summaryHash=NSf2df6493ea859e37
02-09-2024 10:37:46.084 INFO  DispatchThread [10449 searchOrchestrator] - Did not find a usable summary_id, setting info._summary_mode=none, not modifying input summary_id=A6ADAC30-27EC-4F28-BEB9-3BD2C7EC3E53_Ta-Purplelab_admin_NSf2df6493ea859e37
02-09-2024 10:37:46.085 INFO  SearchParser [10449 searchOrchestrator] - PARSING: | makeresults | eval technique_id="T1059.003" | where isnotnull(technique_id) | mitrepurplelab T1059.003
02-09-2024 10:37:46.085 INFO  ChunkedExternProcessor [10449 searchOrchestrator] - Running process: /opt/splunk/bin/python3.7 /opt/splunk/etc/apps/Ta-Purplelab/bin/mitrepurplelab.py
02-09-2024 10:37:46.155 ERROR ChunkedExternProcessor [10449 searchOrchestrator] - Failed attempting to parse transport header: Usage: python script.py &amp;lt;technique_id&amp;gt;
02-09-2024 10:37:46.161 ERROR ChunkedExternProcessor [10449 searchOrchestrator] - Error in 'mitrepurplelab' command: External search command exited unexpectedly.
02-09-2024 10:37:46.161 INFO  ScopedTimer [10449 searchOrchestrator] - search.optimize 0.076785640
02-09-2024 10:37:46.161 WARN  SearchPhaseGenerator [10449 searchOrchestrator] - AST processing error, exception=31SearchProcessorMessageException, error=Error in 'mitrepurplelab' command: External search command exited unexpectedly.. Fall back to 2 phase.
02-09-2024 10:37:46.161 INFO  SearchPhaseGenerator [10449 searchOrchestrator] -  Executing two phase fallback for the search=| makeresults | eval technique_id="T1059.003" | where isnotnull(technique_id) | mitrepurplelab T1059.003
02-09-2024 10:37:46.161 INFO  SearchParser [10449 searchOrchestrator] - PARSING: | makeresults | eval technique_id="T1059.003" | where isnotnull(technique_id) | mitrepurplelab T1059.003
02-09-2024 10:37:46.162 INFO  ChunkedExternProcessor [10449 searchOrchestrator] - Running process: /opt/splunk/bin/python3.7 /opt/splunk/etc/apps/Ta-Purplelab/bin/mitrepurplelab.py
02-09-2024 10:37:46.232 ERROR ChunkedExternProcessor [10449 searchOrchestrator] - Failed attempting to parse transport header: Usage: python script.py &amp;lt;technique_id&amp;gt;
02-09-2024 10:37:46.239 ERROR ChunkedExternProcessor [10449 searchOrchestrator] - Error in 'mitrepurplelab' command: External search command exited unexpectedly.
02-09-2024 10:37:46.239 ERROR SearchPhaseGenerator [10449 searchOrchestrator] - Fallback to two phase failed with SearchProcessorException: Error in 'mitrepurplelab' command: External search command exited unexpectedly.
02-09-2024 10:37:46.239 WARN  SearchPhaseGenerator [10449 searchOrchestrator] - Failed to create search phases: exception=31SearchProcessorMessageException, error=Error in 'mitrepurplelab' command: External search command exited unexpectedly.
02-09-2024 10:37:46.240 INFO  SearchStatusEnforcer [10449 searchOrchestrator] - sid=admin__admin_VGEtUHVycGxlbGFi__search1_1707475066.37, newState=BAD_INPUT_CANCEL, message=Error in 'mitrepurplelab' command: External search command exited unexpectedly.
02-09-2024 10:37:46.240 ERROR SearchStatusEnforcer [10449 searchOrchestrator] - SearchMessage orig_component=ChunkedExternProcessor sid=admin__admin_VGEtUHVycGxlbGFi__search1_1707475066.37 message_key=CHUNKED:UNEXPECTED_EXIT message=Error in 'mitrepurplelab' command: External search command exited unexpectedly.
02-09-2024 10:37:46.240 INFO  SearchStatusEnforcer [10449 searchOrchestrator] - State changed to BAD_INPUT_CANCEL: Error in 'mitrepurplelab' command: External search command exited unexpectedly.
02-09-2024 10:37:46.240 INFO  SearchStatusEnforcer [10449 searchOrchestrator] - Enforcing disk quota = 10485760000
02-09-2024 10:37:46.242 INFO  DispatchManager [10449 searchOrchestrator] - DispatchManager::dispatchHasFinished(id='admin__admin_VGEtUHVycGxlbGFi__search1_1707475066.37', username='admin')
02-09-2024 10:37:46.242 INFO  UserManager [10449 searchOrchestrator] - Unwound user context: admin -&amp;gt; NULL
02-09-2024 10:37:46.242 INFO  SearchOrchestrator [10446 RunDispatch] - SearchOrchestrator is destructed.  sid=admin__admin_VGEtUHVycGxlbGFi__search1_1707475066.37, eval_only=0
02-09-2024 10:37:46.242 INFO  SearchStatusEnforcer [10446 RunDispatch] - SearchStatusEnforcer is already terminated
02-09-2024 10:37:46.242 INFO  UserManager [10446 RunDispatch] - Unwound user context: admin -&amp;gt; NULL
02-09-2024 10:37:46.242 INFO  LookupDataProvider [10446 RunDispatch] - Clearing out lookup shared provider map
02-09-2024 10:37:46.242 INFO  dispatchRunner [1626 MainThread] - RunDispatch is done: sid=admin__admin_VGEtUHVycGxlbGFi__search1_1707475066.37, exit=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the error seems to come from the fact that the argument went wrong:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;02-09-2024 10:37:46.162 INFO  ChunkedExternProcessor [10449 searchOrchestrator] - Running process: /opt/splunk/bin/python3.7 /opt/splunk/etc/apps/Ta-Purplelab/bin/mitrepurplelab.py
02-09-2024 10:37:46.232 ERROR ChunkedExternProcessor [10449 searchOrchestrator] - Failed attempting to parse transport header: Usage: python script.py &amp;lt;technique_id&amp;gt;
02-09-2024 10:37:46.239 ERROR ChunkedExternProcessor [10449 searchOrchestrator] - Error in 'mitrepurplelab' command: External search command exited unexpectedly.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand why, because you can see that the argument is well transmitted to the custom command.&lt;/P&gt;&lt;P&gt;and I can't retrieve the information about what is transmitted as an argument to the python script by the custom command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any ideas, it would be a great help!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 11:02:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677064#M55429</guid>
      <dc:creator>mcayrol</dc:creator>
      <dc:date>2024-02-09T11:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677067#M55430</link>
      <description>&lt;P&gt;Does the argument need to be in quotes or passed as a field (so the SPL parser doesn't look for a field called&amp;nbsp;&lt;SPAN&gt;T1059.003 and not find it so passes null?&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;query&amp;gt;| makeresults | eval technique_id="$technique_id$" | where isnotnull(technique_id) | mitrepurplelab "$technique_id$"&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;query&amp;gt;| makeresults | eval technique_id="$technique_id$" | where isnotnull(technique_id) | mitrepurplelab technique_id&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Feb 2024 11:35:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677067#M55430</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-02-09T11:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677077#M55437</link>
      <description>&lt;P&gt;It's not that because in the search log we saw that the $technique_id$ is well pass (T1059.003)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;02-09-2024 10:37:46.161 INFO  SearchParser [10449 searchOrchestrator] - PARSING: | makeresults | eval technique_id="T1059.003" | where isnotnull(technique_id) | mitrepurplelab T1059.003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And even when i'm doing this command, I have the same issue :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mitrepurplelab T1059.003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the issue is with the&amp;nbsp;commands.conf&lt;/P&gt;&lt;P&gt;When i put&amp;nbsp;command.arg.1 = $technique_id$ on the commands.conf the script try to run with&amp;nbsp;$technique_id$ as an argument but literraly&amp;nbsp;$technique_id$ not 1059.003 so It doesn't work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 13:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677077#M55437</guid>
      <dc:creator>mcayrol</dc:creator>
      <dc:date>2024-02-09T13:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677081#M55438</link>
      <description>&lt;P&gt;What does your mitrepurplelab.log show as being passed in argv?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;logging.basicConfig(filename='mitrepurplelab.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
def main():
logging.debug(f "Arguments received: {sys.argv}")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Feb 2024 13:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677081#M55438</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-02-09T13:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677093#M55440</link>
      <description>&lt;P&gt;ok so when i'm adding this to commands.conf :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;command.arg.1 = T1059.003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script work well but with the argument is fixed, we don't want that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yeah i set mitrepurplelab.log to have more information and it is interesting because when I&amp;nbsp; do :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mitrepurplelab T1059.003&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2024-02-09 13:29:43,221 - DEBUG - Arguments reçus: ['/opt/splunk/etc/apps/Ta-Purplelab/bin/mitrepurplelab.py']
2024-02-09 13:29:43,221 - ERROR - Usage incorrect: python script.py &amp;lt;technique_id&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Like the T1059.003 was not pass&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And when I launch the script by the dashboard I have the same output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I remove chunked = true&amp;nbsp; and add&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;enableheader = true
outputheader = true
requires_srinfo = true
supports_getinfo = true
supports_multivalues = true
supports_rawargs = true
python.version = python3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To commands.conf&lt;/P&gt;&lt;P&gt;I have this ouput :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2024-02-09 13:43:38,870 - DEBUG - Arguments reçus: ['/opt/splunk/etc/apps/Ta-Purplelab/bin/mitrepurplelab.py', '__GETINFO__', 'technique_id']
2024-02-09 13:43:38,870 - ERROR - Usage incorrect: python script.py &amp;lt;technique_id&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're getting close...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 13:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677093#M55440</guid>
      <dc:creator>mcayrol</dc:creator>
      <dc:date>2024-02-09T13:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677098#M55441</link>
      <description>&lt;P&gt;What did you get in the mitrepurplelab.log when you tried&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;query&amp;gt;| makeresults | eval technique_id="$technique_id$" | where isnotnull(technique_id) | mitrepurplelab "$technique_id$"&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;and&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;query&amp;gt;| makeresults | eval technique_id="$technique_id$" | where isnotnull(technique_id) | mitrepurplelab technique_id&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Feb 2024 14:17:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677098#M55441</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-02-09T14:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677101#M55442</link>
      <description>&lt;P&gt;I test&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;query&amp;gt;| makeresults | eval technique_id="$technique_id$" | where isnotnull(technique_id) | mitrepurplelab "$technique_id$"&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I got :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2024-02-09 14:24:52,100 - DEBUG - Arguments reçus: ['/opt/splunk/etc/apps/Ta-Purplelab/bin/mitrepurplelab.py', '__GETINFO__', '"T1059.003"']
2024-02-09 14:24:52,100 - ERROR - Usage incorrect: python script.py &amp;lt;technique_id&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This time the Tehnique is well retreive but the syntax is not correct for the script I guess&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 14:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677101#M55442</guid>
      <dc:creator>mcayrol</dc:creator>
      <dc:date>2024-02-09T14:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677102#M55443</link>
      <description>&lt;P&gt;Try removing the extra stuff you put in and set chunked to true again&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 14:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677102#M55443</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-02-09T14:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677104#M55444</link>
      <description>&lt;P&gt;When I do that I have this again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2024-02-09 14:39:40,578 - DEBUG - Arguments reçus: ['/opt/splunk/etc/apps/Ta-Purplelab/bin/mitrepurplelab.py']
2024-02-09 14:39:40,578 - ERROR - Usage incorrect: python script.py &amp;lt;technique_id&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[mitrepurplelab]

chunked = true
python.version = python3
filename = mitrepurplelab.py&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 09 Feb 2024 14:40:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677104#M55444</guid>
      <dc:creator>mcayrol</dc:creator>
      <dc:date>2024-02-09T14:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677109#M55445</link>
      <description>&lt;P&gt;I've found a workaround in the meantime&lt;/P&gt;&lt;P&gt;Since I know what I'm getting, I clean up the arguments before loading them into my python script&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 14:58:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677109#M55445</guid>
      <dc:creator>mcayrol</dc:creator>
      <dc:date>2024-02-09T14:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: [Error] Pass token values from a dashboard as parameters to python script</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677112#M55446</link>
      <description>&lt;P&gt;Try adding&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;supports_rawargs = true&lt;/LI-CODE&gt;&lt;P&gt;Other than that, do you have any documentation for the mitrepurplelab custom command that would indicate what values should be there?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 15:05:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Error-Pass-token-values-from-a-dashboard-as-parameters-to-python/m-p/677112#M55446</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-02-09T15:05:36Z</dc:date>
    </item>
  </channel>
</rss>

