<?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 Python script json in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425047#M7553</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a python script which return a json file like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"address": "Pont Raymond Barre", "address2": "Parvis du Musée des Confluences", "availability": "Vert", "availabilitycode": "1", "available_bike_stands": "2", "available_bikes": "17", "banking": "False", "bike_stands": "20", "bonus": "Non", "code_insee": "69382", "commune": "Lyon 2 ème", "gid": "1107", "last_update": "2018-05-31 10:33:44", "last_update_fme": "2018-05-31 10:35:07", "lat": "45.7333902949857180", "lng": "4.8189455344322543", "name": "Musée des Confluences", "nmarrond": "20", "number": "2020", "pole": "Musée des Confluences", "status": "OPEN"}, {"address": "5 rue Félix Rollet", "address2": "None", "availability": "Gris", "availabilitycode": "0", "available_bike_stands": "0", "available_bikes": "0", "banking": "True", "bike_stands": "20", "bonus": "None", "code_insee": "69383", "commune": "Lyon 3 ème", "gid": "1108", "last_update": "2018-05-31 00:30:02", "last_update_fme": "2018-05-31 00:30:02", "lat": "45.7483920031766260", "lng": "4.8759903056684522", "name": "Friche RVI", "nmarrond": "50", "number": "3050", "pole": "ancienne friche RVI", "status": "OPEN"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works perfectly when I use the command sudo /opt/splunk/bin/splunk cmd python /opt/splunk/etc/apps/bike_sharing/bin/script_velo.py in my terminal but when I try to add it in Splunk, no results are found.&lt;BR /&gt;
Why it doesn't work properly?&lt;/P&gt;

&lt;P&gt;Thank you for your answer&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 19:44:13 GMT</pubDate>
    <dc:creator>csimonnet</dc:creator>
    <dc:date>2020-09-29T19:44:13Z</dc:date>
    <item>
      <title>Python script json</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425047#M7553</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a python script which return a json file like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"address": "Pont Raymond Barre", "address2": "Parvis du Musée des Confluences", "availability": "Vert", "availabilitycode": "1", "available_bike_stands": "2", "available_bikes": "17", "banking": "False", "bike_stands": "20", "bonus": "Non", "code_insee": "69382", "commune": "Lyon 2 ème", "gid": "1107", "last_update": "2018-05-31 10:33:44", "last_update_fme": "2018-05-31 10:35:07", "lat": "45.7333902949857180", "lng": "4.8189455344322543", "name": "Musée des Confluences", "nmarrond": "20", "number": "2020", "pole": "Musée des Confluences", "status": "OPEN"}, {"address": "5 rue Félix Rollet", "address2": "None", "availability": "Gris", "availabilitycode": "0", "available_bike_stands": "0", "available_bikes": "0", "banking": "True", "bike_stands": "20", "bonus": "None", "code_insee": "69383", "commune": "Lyon 3 ème", "gid": "1108", "last_update": "2018-05-31 00:30:02", "last_update_fme": "2018-05-31 00:30:02", "lat": "45.7483920031766260", "lng": "4.8759903056684522", "name": "Friche RVI", "nmarrond": "50", "number": "3050", "pole": "ancienne friche RVI", "status": "OPEN"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works perfectly when I use the command sudo /opt/splunk/bin/splunk cmd python /opt/splunk/etc/apps/bike_sharing/bin/script_velo.py in my terminal but when I try to add it in Splunk, no results are found.&lt;BR /&gt;
Why it doesn't work properly?&lt;/P&gt;

&lt;P&gt;Thank you for your answer&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425047#M7553</guid>
      <dc:creator>csimonnet</dc:creator>
      <dc:date>2020-09-29T19:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python script json</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425048#M7554</link>
      <description>&lt;P&gt;Hi @csimonnet,&lt;/P&gt;

&lt;P&gt;Can you please share configurations file? &lt;BR /&gt;
Meanwhile you can cross verify your configuration using following link.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.0/AdvancedDev/ScriptSetup"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.0/AdvancedDev/ScriptSetup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 10:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425048#M7554</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-05-31T10:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Python script json</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425049#M7555</link>
      <description>&lt;P&gt;What do you mean when you write 'it doesn't work properly?'&lt;BR /&gt;
Is there an error of the script, or the info are not indexed by Splunk?&lt;BR /&gt;
I have a python script building an input that is indexed by splunk.&lt;BR /&gt;
The result indexed by Splunk is in fact the result of a json.dumps(somePythonDico). Please note that this result is different from yours, and would look like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; **[**{"address": "Pont Raymond Barre", "address2": "Parvis du Musée des Confluences", "availability": "Vert", "availabilitycode": "1", "available_bike_stands": "2", "available_bikes": "17", "banking": "False", "bike_stands": "20", "bonus": "Non", "code_insee": "69382", "commune": "Lyon 2 ème", "gid": "1107", "last_update": "2018-05-31 10:33:44", "last_update_fme": "2018-05-31 10:35:07", "lat": "45.7333902949857180", "lng": "4.8189455344322543", "name": "Musée des Confluences", "nmarrond": "20", "number": "2020", "pole": "Musée des Confluences", "status": "OPEN"}, {"address": "5 rue Félix Rollet", "address2": "None", "availability": "Gris", "availabilitycode": "0", "available_bike_stands": "0", "available_bikes": "0", "banking": "True", "bike_stands": "20", "bonus": "None", "code_insee": "69383", "commune": "Lyon 3 ème", "gid": "1108", "last_update": "2018-05-31 00:30:02", "last_update_fme": "2018-05-31 00:30:02", "lat": "45.7483920031766260", "lng": "4.8759903056684522", "name": "Friche RVI", "nmarrond": "50", "number": "3050", "pole": "ancienne friche RVI", "status": "OPEN"}**]**
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In addition, check the content of the inputs.conf file, as described in &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.0/AdvancedDev/ScriptSetup"&gt;https://docs.splunk.com/Documentation/Splunk/7.1.0/AdvancedDev/ScriptSetup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 11:28:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425049#M7555</guid>
      <dc:creator>poete</dc:creator>
      <dc:date>2018-05-31T11:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Python script json</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425050#M7556</link>
      <description>&lt;P&gt;&lt;STRONG&gt;[&lt;/STRONG&gt; is meant for a bold [&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 11:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425050#M7556</guid>
      <dc:creator>poete</dc:creator>
      <dc:date>2018-05-31T11:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python script json</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425051#M7557</link>
      <description>&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;[script://$SPLUNK_HOME/etc/apps/bike_sharing/bin/script_velo.py]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
index = bike_sharing&lt;BR /&gt;
interval = 60.0&lt;BR /&gt;
sourcetype = _json_velo_rest&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;[_json_velo_rest]&lt;BR /&gt;
BREAK_ONLY_BEFORE =&lt;BR /&gt;
DATETIME_CONFIG =&lt;BR /&gt;
KV_MODE = json&lt;BR /&gt;
LINE_BREAKER = }(,)\s{"status"&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
SEDCMD-add_closing_bracket = s/\s$/ }/g&lt;BR /&gt;
SEDCMD-correctly-close = s/}\s}\s}/\n/g&lt;BR /&gt;
TIME_PREFIX = "last_update"&lt;BR /&gt;
TRUNCATE = 0&lt;BR /&gt;
category = Custom&lt;BR /&gt;
crcSalt = &amp;lt;SOURCE&amp;gt;&lt;BR /&gt;
description = json pour API rest velo&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = 1&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
EVAL-taux_occupation = available_bikes/bike_stands&lt;/P&gt;

&lt;P&gt;transform.conf is empty&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:44:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Python-script-json/m-p/425051#M7557</guid>
      <dc:creator>csimonnet</dc:creator>
      <dc:date>2020-09-29T19:44:24Z</dc:date>
    </item>
  </channel>
</rss>

