<?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 Can I parse my log with a python script before indexing? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345549#M5394</link>
    <description>&lt;P&gt;Hi! &lt;BR /&gt;
I'm reading the scripted input documentation but I don't understand if they can help me in what I'd like to do.&lt;BR /&gt;
I would like to be able to save some types of different logs in the same format.&lt;BR /&gt;
Is it possible to use a python script to receive logs and parser them?&lt;BR /&gt;
The logs are complex and to get a unique dashboard I first have to extract all the fields for each format and use custom search command (that I created already with intersplunk to created new fields).&lt;BR /&gt;
I would prefer to do an initial parsing in order to extract the same fields from all sources and created new fields (and saved that).&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Example:&lt;/EM&gt; (it's just a simplified example of my situation)&lt;BR /&gt;
&lt;STRONG&gt;format1&lt;/STRONG&gt;: ###EXPECTED### {"field1":"value1} ###ACTUAL### {"field1":"value2","field2":"value1"}&lt;BR /&gt;
&lt;STRONG&gt;format2&lt;/STRONG&gt;: timestamp \n exp_field: {"field1":"value1}\n act_field {"field1":"value2","field2":"value1"}&lt;/P&gt;

&lt;P&gt;In my dashboard I would like a count of different fields between jsons.&lt;BR /&gt;
Now I need to extract the fileds with two different regExp and then use a custom command that extracts the different fields between the two jsons.&lt;BR /&gt;
I would like to do everything before indexing. It's possible?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Deb&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:17:24 GMT</pubDate>
    <dc:creator>drebai</dc:creator>
    <dc:date>2020-09-29T17:17:24Z</dc:date>
    <item>
      <title>Can I parse my log with a python script before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345549#M5394</link>
      <description>&lt;P&gt;Hi! &lt;BR /&gt;
I'm reading the scripted input documentation but I don't understand if they can help me in what I'd like to do.&lt;BR /&gt;
I would like to be able to save some types of different logs in the same format.&lt;BR /&gt;
Is it possible to use a python script to receive logs and parser them?&lt;BR /&gt;
The logs are complex and to get a unique dashboard I first have to extract all the fields for each format and use custom search command (that I created already with intersplunk to created new fields).&lt;BR /&gt;
I would prefer to do an initial parsing in order to extract the same fields from all sources and created new fields (and saved that).&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Example:&lt;/EM&gt; (it's just a simplified example of my situation)&lt;BR /&gt;
&lt;STRONG&gt;format1&lt;/STRONG&gt;: ###EXPECTED### {"field1":"value1} ###ACTUAL### {"field1":"value2","field2":"value1"}&lt;BR /&gt;
&lt;STRONG&gt;format2&lt;/STRONG&gt;: timestamp \n exp_field: {"field1":"value1}\n act_field {"field1":"value2","field2":"value1"}&lt;/P&gt;

&lt;P&gt;In my dashboard I would like a count of different fields between jsons.&lt;BR /&gt;
Now I need to extract the fileds with two different regExp and then use a custom command that extracts the different fields between the two jsons.&lt;BR /&gt;
I would like to do everything before indexing. It's possible?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Deb&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345549#M5394</guid>
      <dc:creator>drebai</dc:creator>
      <dc:date>2020-09-29T17:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can I parse my log with a python script before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345550#M5395</link>
      <description>&lt;P&gt;Yes, it's possible.  I've written a number of Python scripts that read events from a source and transform them before handing them to Splunk for indexing.  In a scripted input, your script does the work of reading the source data - there is nothing to "receive".  The script opens the file or makes a REST request or does something else to get its input then it does the transformation and writes the results to stdout.  Whatever goes to stdout is what Splunk will index.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345550#M5395</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-12-14T14:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can I parse my log with a python script before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345551#M5396</link>
      <description>&lt;P&gt;Thank you!&lt;BR /&gt;
Are there any guides or examples?&lt;BR /&gt;
I only find things concerning the exclusion of fields directly from the input.conf&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:45:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345551#M5396</guid>
      <dc:creator>drebai</dc:creator>
      <dc:date>2017-12-14T14:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can I parse my log with a python script before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345552#M5397</link>
      <description>&lt;P&gt;Here is an example:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/AdvancedDev/ScriptExample"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/AdvancedDev/ScriptExample&lt;/A&gt;&lt;BR /&gt;
As @richgalloway said, whatever goes to stdout (via "print") is what Splunk will index. So add a few lines in your Python script to format the output as needed.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 14:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-I-parse-my-log-with-a-python-script-before-indexing/m-p/345552#M5397</guid>
      <dc:creator>Yunagi</dc:creator>
      <dc:date>2017-12-14T14:54:26Z</dc:date>
    </item>
  </channel>
</rss>

