<?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: Retrieve lookup data with JS in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409817#M118214</link>
    <description>&lt;P&gt;This article seems relevant &lt;BR /&gt;
&lt;A href="https://stackoverflow.com/questions/12250065/receive-csv-file-as-data-in-ajax-success-function"&gt;https://stackoverflow.com/questions/12250065/receive-csv-file-as-data-in-ajax-success-function&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jun 2018 12:45:24 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2018-06-26T12:45:24Z</dc:date>
    <item>
      <title>Retrieve lookup data with JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409815#M118212</link>
      <description>&lt;P&gt;Hello splunkers, i'm gonna try to be short, I'm trying to create an HTML homepage for Splunk APP and I've been trying to get some information through a lookup without splunkJS or any splunk code (i'm doing this because splunk is spoiling my CSS pages and I need to customize this page view and customize either the way I handle this lookup data). &lt;/P&gt;

&lt;P&gt;OBS.: I have my JS and lookup in the same app, I tried to  do something like this: &lt;BR /&gt;
&lt;CODE&gt;$.ajax({&lt;BR /&gt;
        url: '../../../../lookups/ccm_links.csv',&lt;BR /&gt;
        dataType: 'text',&lt;BR /&gt;
    }).done(successFunction);&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 10:39:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409815#M118212</guid>
      <dc:creator>ppatrikfr</dc:creator>
      <dc:date>2018-06-26T10:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve lookup data with JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409816#M118213</link>
      <description>&lt;P&gt;Way too few details for me to help here.  I know you were being short...&lt;/P&gt;

&lt;P&gt;So I see you’re working with Ajax.  What is your preferred language to do this in?  php, js, whatever?&lt;/P&gt;

&lt;P&gt;What are you doing with the lookup once you have it?  Writing,&lt;BR /&gt;
Reading, Parsing, etc.?  &lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 12:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409816#M118213</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-06-26T12:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve lookup data with JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409817#M118214</link>
      <description>&lt;P&gt;This article seems relevant &lt;BR /&gt;
&lt;A href="https://stackoverflow.com/questions/12250065/receive-csv-file-as-data-in-ajax-success-function"&gt;https://stackoverflow.com/questions/12250065/receive-csv-file-as-data-in-ajax-success-function&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 12:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409817#M118214</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-06-26T12:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve lookup data with JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409818#M118215</link>
      <description>&lt;P&gt;Sorry for missing information.&lt;BR /&gt;
1) I preferred js, but I can work with everything and I'm just using AJAX because it worked when I was testing on my computer but  when I tried to do the same on server it didn't got the same result.&lt;/P&gt;

&lt;P&gt;2) I'll read this information and split it up depending to the categories I'll determinate (using REGEX or a simple string comparison).&lt;/P&gt;

&lt;P&gt;I'm just having some trouble while i'm trying to get lookup's data from splunk's folder.&lt;/P&gt;

&lt;P&gt;EX: Lookups path : &lt;CODE&gt;MYDISK:\Splunk\etc\apps\(APP_NAME)\lookups&lt;/CODE&gt;&lt;BR /&gt;
My script path: &lt;CODE&gt;MYDISK:\Splunk\etc\apps\(APP_NAME)\appserver\static&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 13:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409818#M118215</guid>
      <dc:creator>ppatrikfr</dc:creator>
      <dc:date>2018-06-26T13:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve lookup data with JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409819#M118216</link>
      <description>&lt;P&gt;Would this help?&lt;/P&gt;

&lt;P&gt;var loc = window.location.pathname;&lt;BR /&gt;
var dir = loc.substring(0, loc.lastIndexOf('/'));&lt;/P&gt;

&lt;P&gt;first uses js to find the current working directory the other is just a way to grab the last directory name in the current working directory.&lt;/P&gt;

&lt;P&gt;What I would do is print the first var and see what it says.  Then I would use the same method you have with the ../../../ etc to get back to the apps main directory and into the lookups folder and file.&lt;/P&gt;

&lt;P&gt;Be sure to check permissions and that the user running your js UI has permissions on that lookup file.&lt;/P&gt;

&lt;P&gt;Also check your logs to see&lt;BR /&gt;
If there are any permissions errors, file not found, etc&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 13:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Retrieve-lookup-data-with-JS/m-p/409819#M118216</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-06-26T13:11:58Z</dc:date>
    </item>
  </channel>
</rss>

