<?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: Timechart command in lookup or CSV File in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360063#M106464</link>
    <description>&lt;P&gt;I just copied your entire lookup in the image and tried this myself by creating a .csv.&lt;/P&gt;

&lt;P&gt;I don't have zeros in all rows and so it seems that your csv is not well formatted. Can you try what I just did?&lt;/P&gt;

&lt;P&gt;Create a csv in a plaintext file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time,image_name,os_name
10/01/2018, azure1, CentOS7
10/02/2018, azure1, CentOS7
15/02/2018, azure1, CentOS7
20/02/2018, azure3, CentOS7
10/03/2018, azure3, CentOS7
11/03/2018, azure2, CentOS7
12/03/2018, azure2, CentOS7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Save it like this and to  csv_timechart.csv, put it in the lookup folder of the app you are using, and run the command I told you.&lt;/P&gt;

&lt;P&gt;Feed us back please&lt;/P&gt;</description>
    <pubDate>Tue, 20 Mar 2018 13:06:10 GMT</pubDate>
    <dc:creator>tiagofbmm</dc:creator>
    <dc:date>2018-03-20T13:06:10Z</dc:date>
    <item>
      <title>Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360055#M106456</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I have a scheduled search which generates a lookup file similar to below&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/229778-lookup.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Whenever i run stats command on this data it runs perfectly fine. But whenever i try to run timechart command it doesnt work, like below&lt;/P&gt;

&lt;P&gt;search ...| timechart count by image_name&lt;BR /&gt;
search ... | timechart count(image_name)&lt;/P&gt;

&lt;P&gt;or any permutation i try with i get either zero or null but not the actuall count or aggregate function. Basically i am looking to use span/bin on this data but i am unable to do that so thought of using timechart command.&lt;/P&gt;

&lt;P&gt;I have properly formatted the time to _time by converting into epoch time and then into %c standard format.&lt;/P&gt;

&lt;P&gt;I am not sure why timechart is not working on the lookup/csv file data.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:32:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360055#M106456</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2020-09-29T18:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360056#M106457</link>
      <description>&lt;P&gt;Can you provide query you are using for converting?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 08:13:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360056#M106457</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-20T08:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360057#M106458</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;

&lt;P&gt;Please try this option:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup csv_timechart.csv
| eval _time=strptime(_time,"%m/%d/%Y")
| timechart count by image_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 08:21:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360057#M106458</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-20T08:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360058#M106459</link>
      <description>&lt;P&gt;Hi ashish9433,&lt;BR /&gt;
what's your need? &lt;BR /&gt;
do you want to count values or only display them?&lt;/P&gt;

&lt;P&gt;if you want to count events or sum values you could use chart command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_search
| chart count over _time BY image_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If instead you want only to display values, you could use table command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my_search
| table _time image_name os_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 08:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360058#M106459</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-03-20T08:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360059#M106460</link>
      <description>&lt;P&gt;Hi @ashish9433 ,&lt;BR /&gt;
Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH | eval _time=strptime(_time,"%m/%d/%Y")| timechart count by image_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 08:26:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360059#M106460</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-03-20T08:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360060#M106461</link>
      <description>&lt;P&gt;I already did this, the problem is the result is shown as list of all image_name as columns and date as rows with all zero in all the row of all the cloumns and thus the issue! &lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 12:48:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360060#M106461</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2018-03-20T12:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360061#M106462</link>
      <description>&lt;P&gt;I want to group by span=15d and have a visualization and also use a single value with trend indicator option.&lt;BR /&gt;
I tried span, bin and timechart none of them is working on lookup data.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 12:50:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360061#M106462</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2018-03-20T12:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360062#M106463</link>
      <description>&lt;P&gt;I already did this, the problem is the result is shown as list of all image_name as columns and date as rows with all zero in all the row of all the cloumns and thus the issue! &lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 12:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360062#M106463</guid>
      <dc:creator>ashish9433</dc:creator>
      <dc:date>2018-03-20T12:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart command in lookup or CSV File</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360063#M106464</link>
      <description>&lt;P&gt;I just copied your entire lookup in the image and tried this myself by creating a .csv.&lt;/P&gt;

&lt;P&gt;I don't have zeros in all rows and so it seems that your csv is not well formatted. Can you try what I just did?&lt;/P&gt;

&lt;P&gt;Create a csv in a plaintext file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time,image_name,os_name
10/01/2018, azure1, CentOS7
10/02/2018, azure1, CentOS7
15/02/2018, azure1, CentOS7
20/02/2018, azure3, CentOS7
10/03/2018, azure3, CentOS7
11/03/2018, azure2, CentOS7
12/03/2018, azure2, CentOS7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Save it like this and to  csv_timechart.csv, put it in the lookup folder of the app you are using, and run the command I told you.&lt;/P&gt;

&lt;P&gt;Feed us back please&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 13:06:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-command-in-lookup-or-CSV-File/m-p/360063#M106464</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-20T13:06:10Z</dc:date>
    </item>
  </channel>
</rss>

