<?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: Infos over REST API from CSV Files in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380301#M68670</link>
    <description>&lt;P&gt;Awesome!&lt;/P&gt;

&lt;P&gt;I had tried something similar before but couldn't figure out how to get the size of a whole row. Didn't think about going through each field separately.&lt;BR /&gt;
Quite resource intensive, though, as you mention in the code itself.&lt;/P&gt;

&lt;P&gt;Doesn't work well for me when using the REST endpoint&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|rest/services/data/lookup-table-files splunk_server=local&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This one works better for me:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|rest /servicesNS/$env:user$/$env:app$/data/lookup-table-files splunk_server=local&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;And all the $TOTAL_FIELD_VALUE$ cause problems in my dashboard as I use a form, replacing it with #TOTAL_FIELD_VALUE# works fine.&lt;/P&gt;

&lt;P&gt;Still, awesome!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:53:03 GMT</pubDate>
    <dc:creator>usd0872</dc:creator>
    <dc:date>2020-09-29T23:53:03Z</dc:date>
    <item>
      <title>Infos over REST API from CSV Files</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380297#M68666</link>
      <description>&lt;P&gt;Is there a default possibility for a user&lt;BR /&gt;
get a list of all CSV files for an app&lt;BR /&gt;
to determine the size of the individual CSV files&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 10:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380297#M68666</guid>
      <dc:creator>bardill</dc:creator>
      <dc:date>2019-03-26T10:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Infos over REST API from CSV Files</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380298#M68667</link>
      <description>&lt;P&gt;in The Moment i do this so&lt;BR /&gt;
 &lt;A href="https://server:0000/services/data/lookup-table-files"&gt;https://server:0000/services/data/lookup-table-files&lt;/A&gt;&lt;BR /&gt;
but i have no &lt;STRONG&gt;size&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 11:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380298#M68667</guid>
      <dc:creator>bardill</dc:creator>
      <dc:date>2019-03-26T11:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Infos over REST API from CSV Files</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380299#M68668</link>
      <description>&lt;P&gt;AFAIK, the REST endpoint for lookup table files doesn't show size information for the lookup.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 14:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380299#M68668</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-03-26T14:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Infos over REST API from CSV Files</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380300#M68669</link>
      <description>&lt;P&gt;No, but you can calculate it with a search in a dashboard panel like this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
  &amp;lt;title&amp;gt;Lookup table details (beware "Bundle too large" replication errors) - WARNING: may take a long time to complete; sizes and percentages are APPROXIMATE&amp;lt;/title&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;title&amp;gt;The warning will be this: Bundle Replication: Problem replicating config (bundle) to search peer ' &amp;lt;hostname&amp;gt;:8089 ', HTTP response code 413 (HTTP/1.1 413 Content-Length of &amp;lt;size here&amp;gt; too large (maximum is 838860800)). Content-Length of &amp;lt;size here&amp;gt; too large (maximum is 838860800) (Unknown write error)&amp;lt;/title&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;|rest/services/data/lookup-table-files splunk_server=local
| search eai:acl.app="$env:app$"
| rename dispatch.* AS *
| rename eai:acl.* AS *
| map maxsearches=99 search="
| inputlookup $$title$$
| rename COMMENT1of3 AS \"Some field names have single-quotes which will cause this error:\"
| rename COMMENT3of3 AS \"{map}: Failed to parse templatized search for field 'Bad Field's Name Here'\"
| rename COMMENT3of3 AS \"So rename those fields before we process them to replace ' with _\"
| rename *'*'*'*'* AS *_*_*_*_*, *'*'*'* AS *_*_*_*, *'*'* AS *_*_*, *'* AS *_*
| eval T3MpJuNk_bytes=0, T3MpJuNk_cols=0, T3MpJuNk_field_names=\",\"
| foreach _*
    [ eval T3MpJuNk_bytes = T3MpJuNk_bytes + coalesce(len('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'), 0)
    | eval T3MpJuNk_cols = T3MpJuNk_cols + 1
    | eval T3MpJuNk_field_names = T3MpJuNk_field_names . \"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;\"]
| rename _* AS *, T3MpJuNk_* AS _T3MpJuNk_*
| foreach *
    [ eval _T3MpJuNk_bytes = _T3MpJuNk_bytes + coalesce(len('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'), 0)
    | eval _T3MpJuNk_cols = _T3MpJuNk_cols + 1
    | eval _T3MpJuNk_field_names = _T3MpJuNk_field_names . \"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;\"]
| rename COMMENT AS \"Account for the commas, too!\"
| eval bytes = bytes + (cols - 1)
| stats sum(_T3MpJuNk_bytes) AS bytes count AS lines first(_T3MpJuNk_cols) AS cols first(_T3MpJuNk_field_names) AS field_names
| rename COMMENT AS \"Account for the header line, too!\"
| eval bytes = bytes + (len(field_names) - 1)
| eval title=\"$$title$$\"
| eval owner=\"$$owner$$\"" 
| eval bytes = coalesce(bytes, 0)
| addtotals row=false col=true labelfield=title label="$TOTAL_FIELD_VALUE$" 
| eval "bytes/line" = if(title=="$TOTAL_FIELD_VALUE$", "N/A", round(coalesce(bytes/lines, 0), 2))
| eval owner = if(title=="$TOTAL_FIELD_VALUE$", "N/A", owner)
| eval cols  = if(title=="$TOTAL_FIELD_VALUE$", "N/A", coalesce(cols, "N/A"))
| eval MB = round(bytes / 1024 / 1024, 2)
| eval bundlePct = round(100 * bytes / 838860800, 2)
| eval status=case(
   title=="$TOTAL_FIELD_VALUE$", if((bundlePct &amp;lt; 90),                         "OK", "DANGEROUS TERRITORY"),
   true(),                       if((bundlePct &amp;lt; 25 AND lines &amp;lt; 10000000), "OK", "Consider KVStore"))
| sort 0 - bytes
| table title status bundlePct owner bytes MB lines cols bytes*line
| eval _drilldown  = if(title=="$TOTAL_FIELD_VALUE$", "*", title)&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
      &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;100&amp;lt;/option&amp;gt;
    &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
    &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
    &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
    &amp;lt;drilldown target="_blank"&amp;gt;
      &amp;lt;link&amp;gt;/manager/$env_app$/data/lookup-table-files?app=$env:app$&amp;amp;amp;app_only=1&amp;amp;amp;count=100&amp;amp;amp;search=$row._drilldown$&amp;lt;/link&amp;gt;
    &amp;lt;/drilldown&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Mar 2019 06:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380300#M68669</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-27T06:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Infos over REST API from CSV Files</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380301#M68670</link>
      <description>&lt;P&gt;Awesome!&lt;/P&gt;

&lt;P&gt;I had tried something similar before but couldn't figure out how to get the size of a whole row. Didn't think about going through each field separately.&lt;BR /&gt;
Quite resource intensive, though, as you mention in the code itself.&lt;/P&gt;

&lt;P&gt;Doesn't work well for me when using the REST endpoint&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|rest/services/data/lookup-table-files splunk_server=local&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This one works better for me:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|rest /servicesNS/$env:user$/$env:app$/data/lookup-table-files splunk_server=local&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;And all the $TOTAL_FIELD_VALUE$ cause problems in my dashboard as I use a form, replacing it with #TOTAL_FIELD_VALUE# works fine.&lt;/P&gt;

&lt;P&gt;Still, awesome!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Infos-over-REST-API-from-CSV-Files/m-p/380301#M68670</guid>
      <dc:creator>usd0872</dc:creator>
      <dc:date>2020-09-29T23:53:03Z</dc:date>
    </item>
  </channel>
</rss>

