<?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 Web form to create events using splunk webserver? in Security</title>
    <link>https://community.splunk.com/t5/Security/Web-form-to-create-events-using-splunk-webserver/m-p/71053#M2344</link>
    <description>&lt;P&gt;We are trying to create a web form (filled in by humans) to create events to be digested by Splunk.&lt;/P&gt;

&lt;P&gt;Now there are a few ways to do this&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Install webserver (apache or iis) and have a php (or .net) script which will process the form and send to splunk via (syslog, tcp or write to monitored file/directory)&lt;/LI&gt;
&lt;LI&gt;Install webserver and have javascript send results via tcp directly to splunk.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Now I am wondering if instead is using a webserver would it be possible to piggy back these forms in the splunk web at all?&lt;/P&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2012 05:19:21 GMT</pubDate>
    <dc:creator>phoenixdigital</dc:creator>
    <dc:date>2012-09-26T05:19:21Z</dc:date>
    <item>
      <title>Web form to create events using splunk webserver?</title>
      <link>https://community.splunk.com/t5/Security/Web-form-to-create-events-using-splunk-webserver/m-p/71053#M2344</link>
      <description>&lt;P&gt;We are trying to create a web form (filled in by humans) to create events to be digested by Splunk.&lt;/P&gt;

&lt;P&gt;Now there are a few ways to do this&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Install webserver (apache or iis) and have a php (or .net) script which will process the form and send to splunk via (syslog, tcp or write to monitored file/directory)&lt;/LI&gt;
&lt;LI&gt;Install webserver and have javascript send results via tcp directly to splunk.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Now I am wondering if instead is using a webserver would it be possible to piggy back these forms in the splunk web at all?&lt;/P&gt;

&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2012 05:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Web-form-to-create-events-using-splunk-webserver/m-p/71053#M2344</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2012-09-26T05:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Web form to create events using splunk webserver?</title>
      <link>https://community.splunk.com/t5/Security/Web-form-to-create-events-using-splunk-webserver/m-p/71054#M2345</link>
      <description>&lt;P&gt;Yes, I would take this as definately being possible...&lt;/P&gt;

&lt;P&gt;You would first need to create your form to handle the right amount of inputs, where you can use typical form features (text input, dropdown lists (you use a lookup file (via &lt;CODE&gt;inputlookup&lt;/CODE&gt; command) or search results for this)... Don't worry about the search for now. (&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Developer/Step1CreateAForm"&gt;Documentation here&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;Then you will need to create a script (something in python would be ideal), this should be created to handle &lt;CODE&gt;sys.argv[]&lt;/CODE&gt; inputs, which will basically be the user's input. You could then have this data formatted to your needs via your script. Have this script write to a file somewhere on the Splunk installation. Once you have set up your script, you will then need to add this to a custom command via the "commmands.conf" file. (&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Developer/SearchScripts"&gt;Documentation here&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;Now, back to the form, you will need a search for the form using your custom command. I typically use a search starting with &lt;CODE&gt;|inputlookup&lt;/CODE&gt; OR &lt;CODE&gt;|metadata&lt;/CODE&gt; as these usually have little search overhead. Then pipe to your custom command. You will then assign the user inputs to the custom command as arguments. For example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|inputlookup foo | someCommand $arg1$ $arg2$ $arg3$ $arg4$ $arg5$&lt;/CODE&gt; etc&lt;/P&gt;

&lt;P&gt;Then once you have the form writing to the file, have Splunk monitor this file for updates.&lt;/P&gt;

&lt;P&gt;May not be the best way but I have had some weird requests that this has helped with.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;MHibbin&lt;/P&gt;

&lt;P&gt;P.S there are probably better methods, but I think this is the easiest to set-up... and why install a web server? Splunk comes packaged with cherryPy as it's webservice.&lt;/P&gt;

&lt;P&gt;P.P.S. If you set up some output to stdout, you can use the event viewer for a form to show the user some information, like "You are not a real person, try again".&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2012 09:01:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Web-form-to-create-events-using-splunk-webserver/m-p/71054#M2345</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-09-26T09:01:37Z</dc:date>
    </item>
  </channel>
</rss>

