<?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: Plot graph using lookup file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658750#M227523</link>
    <description>&lt;P&gt;&lt;STRONG&gt;_time&lt;/STRONG&gt; field looks something&amp;nbsp;like "&lt;STRONG&gt;2023-09-06T18:30:00.000+00:00" &lt;/STRONG&gt;in&amp;nbsp;the lookup CSV. Whereas in the results generated by the query it looks like "&lt;STRONG&gt;2023-09-06 18:30:00&lt;/STRONG&gt;"&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;I tried converting the &lt;STRONG&gt;_time&lt;/STRONG&gt; field as suggested with help of one of solutions provided earlier by you (&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-to-epoch/m-p/658254#M227384" target="_blank"&gt;Solved: Re: convert date to epoch - Splunk Community)&lt;/A&gt;. But no luck. Can you please help with the query?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2023 13:28:23 GMT</pubDate>
    <dc:creator>shreyasbsharma</dc:creator>
    <dc:date>2023-09-26T13:28:23Z</dc:date>
    <item>
      <title>Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658737#M227518</link>
      <description>&lt;P&gt;Hi Team,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a got a request to plot graph of previous 30 days. But the org has a retention period of 7days set on the data set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a solution, I am pushing data from query having HTTP status captured to a lookup file. The CSV file consists of following fields:&lt;/P&gt;&lt;P&gt;1. _time&lt;BR /&gt;2. 2xx&lt;BR /&gt;3. 4xx&lt;BR /&gt;4. 5xx&lt;/P&gt;&lt;P&gt;Also, I have created a time-based lookup definition.&lt;BR /&gt;&lt;BR /&gt;But when I try to plot the graph, "&lt;STRONG&gt;_time&lt;/STRONG&gt;" field is not coming up in x-axis.&amp;nbsp; Can you please help with how this can be achieved?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 11:23:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658737#M227518</guid>
      <dc:creator>shreyasbsharma</dc:creator>
      <dc:date>2023-09-26T11:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658743#M227520</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This might not be the answer you are looking for, but a better practice for your use case would be to use&amp;nbsp;&lt;A href="https://docs.splunk.com/Splexicon:Summaryindex" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Summary Indexing&lt;/STRONG&gt;&lt;/A&gt;. You would do basically the same as you do with the lookup but use an index instead. With this, you would be able to search your data as you would any other indexes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;smurf&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 11:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658743#M227520</guid>
      <dc:creator>smurf</dc:creator>
      <dc:date>2023-09-26T11:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658745#M227521</link>
      <description>&lt;P&gt;How is the _time field stored in your lookup? If it is a string, then you may need to use the strptime() function to parse it into an epoch time for use in the chart.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 12:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658745#M227521</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-09-26T12:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658750#M227523</link>
      <description>&lt;P&gt;&lt;STRONG&gt;_time&lt;/STRONG&gt; field looks something&amp;nbsp;like "&lt;STRONG&gt;2023-09-06T18:30:00.000+00:00" &lt;/STRONG&gt;in&amp;nbsp;the lookup CSV. Whereas in the results generated by the query it looks like "&lt;STRONG&gt;2023-09-06 18:30:00&lt;/STRONG&gt;"&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;I tried converting the &lt;STRONG&gt;_time&lt;/STRONG&gt; field as suggested with help of one of solutions provided earlier by you (&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-to-epoch/m-p/658254#M227384" target="_blank"&gt;Solved: Re: convert date to epoch - Splunk Community)&lt;/A&gt;. But no luck. Can you please help with the query?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 13:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658750#M227523</guid>
      <dc:creator>shreyasbsharma</dc:creator>
      <dc:date>2023-09-26T13:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658752#M227524</link>
      <description>&lt;P&gt;Please share your full search (anonymised as necessary) preferably in&amp;nbsp; as code block &amp;lt;/&amp;gt; to preserve formatting.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 13:45:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658752#M227524</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-09-26T13:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658799#M227534</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;I tried converting the &lt;STRONG&gt;_time&lt;/STRONG&gt; field as suggested with help of one of solutions provided earlier by you (&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-to-epoch/m-p/658254#M227384" target="_blank" rel="noopener"&gt;Solved: Re: convert date to epoch - Splunk Community)&lt;/A&gt;. But no luck. Can you please help with the query?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Did you consult&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Commontimeformatvariables#Date_and_time_format_variables" target="_blank" rel="noopener"&gt;Date and time format variables&lt;/A&gt;&amp;nbsp;when you try that solution? &amp;nbsp;The solution is provided for that particular format. &amp;nbsp;In your case, it would be something like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;strptime(_time, "%FT%H:%M:%S.%Q%:z")&lt;/LI-CODE&gt;&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;_time&lt;/STRONG&gt; field looks something&amp;nbsp;like "&lt;STRONG&gt;2023-09-06T18:30:00.000+00:00" &lt;/STRONG&gt;in&amp;nbsp;the lookup CSV. Whereas in the results generated by the query it looks like "&lt;STRONG&gt;2023-09-06 18:30:00&lt;/STRONG&gt;"&lt;/BLOCKQUOTE&gt;&lt;P&gt;If you have control over this lookup file, rename the _time field to something else like "time" instead. &amp;nbsp;Splunk does some funny things when it sees _ as the first character of a field name. &amp;nbsp;This causes more confusion than it is worth. &amp;nbsp;In your case, Splunk is trying to interpret the field as an internal field and gives its best shot at presentation, but internally, it is still represented as string. &amp;nbsp;This causes your chart command to not have time axis. &amp;nbsp;It is best to reserve _fieldname for Splunk's internal use.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 21:44:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/658799#M227534</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-09-26T21:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/659583#M227728</link>
      <description>&lt;P&gt;Thank&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;. I had missed "%FT%" &amp;amp; ":z" when i tried.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Here are few things i have tried till now :&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup 7days_Trail.csv
| eval time=strptime(_time, "%FT%H:%M:%S.%Q:%z")
| table time 2xx 4xx 5xx&lt;/LI-CODE&gt;&lt;P&gt;After using the above query, the data looks like below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shreyasbsharma_0-1696401811443.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27439iF3C4D504AAEEF0D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shreyasbsharma_0-1696401811443.png" alt="shreyasbsharma_0-1696401811443.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and the graph looks like where time was not getting updated/populated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shreyasbsharma_1-1696401880597.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27440iB48C10BE0403788A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shreyasbsharma_1-1696401880597.png" alt="shreyasbsharma_1-1696401880597.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Since _time was not getting populated even after formatting, i used table command directly. Looks like its working. Can you please confirm if I can use this approach ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shreyasbsharma_2-1696402051243.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/27441iCA30FA7877BBBA4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shreyasbsharma_2-1696402051243.png" alt="shreyasbsharma_2-1696402051243.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 06:49:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/659583#M227728</guid>
      <dc:creator>shreyasbsharma</dc:creator>
      <dc:date>2023-10-04T06:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Plot graph using lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/659586#M227729</link>
      <description>&lt;P&gt;You got it backwards. &amp;nbsp;strptime can get you _time into the real time value so you can use timechart. &amp;nbsp;Why name the variable time instead of _time? &amp;nbsp;timechart command only works with field _time.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup 7days_Trail.csv
| eval _time=strptime(_time, "%FT%H:%M:%S.%Q:%z")
| timechart avg(*) as *&lt;/LI-CODE&gt;&lt;P&gt;You can replace avg with any stats function that suits your need.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 07:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Plot-graph-using-lookup-file/m-p/659586#M227729</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-10-04T07:07:38Z</dc:date>
    </item>
  </channel>
</rss>

