<?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: How to write to CSV file in splunk without using a search manager in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-write-to-CSV-file-in-splunk-without-using-a-search/m-p/247021#M47664</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
If you are looking for an "out of splunk" solution... you will need some server side scripting. You can use XMLHttpRequest Object in your client script. Check out the basic tutorial &lt;A href="http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp"&gt;here.&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2016 13:54:39 GMT</pubDate>
    <dc:creator>Yasaswy</dc:creator>
    <dc:date>2016-05-12T13:54:39Z</dc:date>
    <item>
      <title>How to write to CSV file in splunk without using a search manager</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-write-to-CSV-file-in-splunk-without-using-a-search/m-p/247020#M47663</link>
      <description>&lt;P&gt;Hi , &lt;/P&gt;

&lt;P&gt;We have created a splunk application using HTML format. In our application we have a "Request Alert" button that has a popup which takes user input text fields then writes out to a csv file . The code we are using for this works fine for taking the input field and storing them in a csv file in the local computer. The file location path( we give it works just fine if it is in our local computer , but once we give it the path to where splunk stores all the other csv files that are created , it does not ever work.  &lt;/P&gt;

&lt;P&gt;Is it possible to write to a csv file in splunk without using a search manager ?  I have an example of the code we are using listed below. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;script&amp;gt;

              function closePopup(){
                document.getElementById('light').style.display='none';
                document.getElementById('fade').style.display='none';
              }
                //Save alert details in CSV file

              function writeToFile(d1, d2, d3, d4, d5){
              var fso = new ActiveXObject("Scripting.FileSystemObject");
              var fileLoc = "C:\\Users\\plm3030\\Desktop\\Splunk Docs\\sample.csv";
              var fh = fso.OpenTextFile(fileLoc, 8, false, 0);

              fh.WriteLine(d1 + ',' + d2 + ',' + d3 +',' + d4+',' + d5);
              fh.Close();
              closePopup();
              alert("Your alert submitted successfully!");
              }
              var submitAlert = document.getElementById("submitAlert");
              submitAlert.onclick = function () {
              var queryVal      = document.getElementById("queryVal").value;
              var poc = document.getElementById("poc").value
              var email = document.getElementById("emailGroup").value;
              var alertName = document.getElementById("alertName").value;
              var details = document.getElementById("details").value;
              writeToFile(queryVal, poc, email, alertName, details);
              }
                //End Alert Details to CSV
            &amp;lt;/script&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 May 2016 13:06:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-write-to-CSV-file-in-splunk-without-using-a-search/m-p/247020#M47663</guid>
      <dc:creator>theoborrero</dc:creator>
      <dc:date>2016-05-12T13:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to write to CSV file in splunk without using a search manager</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-write-to-CSV-file-in-splunk-without-using-a-search/m-p/247021#M47664</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
If you are looking for an "out of splunk" solution... you will need some server side scripting. You can use XMLHttpRequest Object in your client script. Check out the basic tutorial &lt;A href="http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp"&gt;here.&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 13:54:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-write-to-CSV-file-in-splunk-without-using-a-search/m-p/247021#M47664</guid>
      <dc:creator>Yasaswy</dc:creator>
      <dc:date>2016-05-12T13:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to write to CSV file in splunk without using a search manager</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-write-to-CSV-file-in-splunk-without-using-a-search/m-p/247022#M47665</link>
      <description>&lt;P&gt;Check out this app (either use it or figure out how it does it):&lt;/P&gt;

&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/1724/"&gt;https://splunkbase.splunk.com/app/1724/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2016 13:33:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-write-to-CSV-file-in-splunk-without-using-a-search/m-p/247022#M47665</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-29T13:33:17Z</dc:date>
    </item>
  </channel>
</rss>

