<?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: Why is my inputlookup search not pulling a field from a CSV file needed to populate a timechart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199964#M57942</link>
    <description>&lt;P&gt;I tried using inputcsv but the same. &lt;BR /&gt;
If I use,  " | inputcsv test.csv |fields state "   , this will give the State and its values&lt;BR /&gt;
But when I use the queries&lt;BR /&gt;
 | inputcsv test.csv | timechart count AS Count BY state&lt;BR /&gt;
 | inputcsv test.csv |fields state| timechart count AS Count BY state&lt;BR /&gt;
 it does not return any data.&lt;/P&gt;</description>
    <pubDate>Mon, 31 Aug 2015 18:42:26 GMT</pubDate>
    <dc:creator>athorat</dc:creator>
    <dc:date>2015-08-31T18:42:26Z</dc:date>
    <item>
      <title>Why is my inputlookup search not pulling a field from a CSV file needed to populate a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199962#M57940</link>
      <description>&lt;P&gt;Requirement was to delete the contents of the index as soon as a new .csv file arrives and index the contents of the new .csv file to use in a dashboard until the next data arrives.&lt;/P&gt;

&lt;P&gt;There is a key value pair called &lt;STRONG&gt;state&lt;/STRONG&gt;, but that is not visible when I use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup  test.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But when I index the data, I see the &lt;STRONG&gt;state&lt;/STRONG&gt; field and can create a timechart.&lt;/P&gt;

&lt;P&gt;This works: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=input.csv |  timechart  count(state) as Count by state
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is when I use: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup test.csv| timechart  count(state) as Count by state
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This does not work as its not able to find the &lt;STRONG&gt;state&lt;/STRONG&gt; field, so I tried to use &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup test.csv|fields state | timechart  count(state) as Count by state 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but even this does not work.&lt;/P&gt;

&lt;P&gt;However, when I used:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup test.csv|fields state 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it pulls the state field.&lt;/P&gt;

&lt;P&gt;How to get the timechart working using inputlookup?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2015 22:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199962#M57940</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2015-08-28T22:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my inputlookup search not pulling a field from a CSV file needed to populate a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199963#M57941</link>
      <description>&lt;P&gt;Try using &lt;CODE&gt;inputcsv&lt;/CODE&gt; instead of &lt;CODE&gt;inputlookup&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv test.csv | timechart count AS Count BY state
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Aug 2015 02:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199963#M57941</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-29T02:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my inputlookup search not pulling a field from a CSV file needed to populate a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199964#M57942</link>
      <description>&lt;P&gt;I tried using inputcsv but the same. &lt;BR /&gt;
If I use,  " | inputcsv test.csv |fields state "   , this will give the State and its values&lt;BR /&gt;
But when I use the queries&lt;BR /&gt;
 | inputcsv test.csv | timechart count AS Count BY state&lt;BR /&gt;
 | inputcsv test.csv |fields state| timechart count AS Count BY state&lt;BR /&gt;
 it does not return any data.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 18:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199964#M57942</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2015-08-31T18:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my inputlookup search not pulling a field from a CSV file needed to populate a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199965#M57943</link>
      <description>&lt;P&gt;There has to be something wrong with your test.csv.  What are the first 2 lines of the file?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 18:58:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199965#M57943</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-31T18:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my inputlookup search not pulling a field from a CSV file needed to populate a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199966#M57944</link>
      <description>&lt;P&gt;assigned_to u_vendor_ticket state   sys_created_on&lt;BR /&gt;
Jyotsna                                    In Progress  6/17/2015 11:50&lt;/P&gt;

&lt;P&gt;u_vendor_ticket does not have any value. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199966#M57944</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2020-09-29T07:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my inputlookup search not pulling a field from a CSV file needed to populate a timechart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199967#M57945</link>
      <description>&lt;P&gt;Based on this first-2-lines sample of test.csv:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;assigned_to u_vendor_ticket state sys_created_on
Jyotsna In Progress 6/17/2015 11:50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is that it isn't a CSV!  There are no commas.  Assuming that the file contains Tabs (TSV) so you can convert it to CSV with linux shell like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sed "s/\t/,/g" test.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In any case, you have to convert it to a CSV (fields separated by commas) before anything will work.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2015 19:12:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-inputlookup-search-not-pulling-a-field-from-a-CSV-file/m-p/199967#M57945</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-31T19:12:08Z</dc:date>
    </item>
  </channel>
</rss>

