<?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: How to do a lookup for timechart headers in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109579#M28593</link>
    <description>&lt;P&gt;What if you did the &lt;CODE&gt;lookup&lt;/CODE&gt; before the &lt;CODE&gt;timechart&lt;/CODE&gt; command and change the  &lt;CODE&gt;timechart&lt;/CODE&gt; command to group by hostname. Something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sflow | eval bytes = formatbytestom(bytes) | lookup ip_lookup ip as src_ip output host as hostname | timechart limit=50 sum(bytes) by hostname 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 May 2016 01:39:37 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-05-06T01:39:37Z</dc:date>
    <item>
      <title>How to do a lookup for timechart headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109574#M28588</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I have made a timechart with a command: &lt;CODE&gt;(...) *| timechart limit=10 sum(bytes) by src_ip*&lt;/CODE&gt; .&lt;/P&gt;

&lt;P&gt;So I got top (really? why? - that is my first question) ten IP addresses - as column headers. Now I want to translate these into hostnames. And my second question: How to do that?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
&lt;EM&gt;&lt;CODE&gt;sflow&lt;/CODE&gt; | eval bytes = &lt;CODE&gt;formatbytestom(bytes)&lt;/CODE&gt; | timechart limit=50 sum(bytes) by src_ip | fields - OTHER | lookup ip_lookup ip as src_ip output host as src_ip&lt;/EM&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;this was my first idea, but it can't work as I don't have src_ip column now, only the 10.245.1.56, 10.245.1.57 etc.
Next idea was to use rename command, but how can I rename every column, for example with eval?
Wildcard is not working here.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The problem is I dont't want to resolve all hostnames before drawing a chart (some thousands of ip addresses - it'd take many minutes), only top ten just after selecting top ten addresses. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109574#M28588</guid>
      <dc:creator>lukasz92</dc:creator>
      <dc:date>2020-09-28T15:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a lookup for timechart headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109575#M28589</link>
      <description>&lt;P&gt;Bump! Is it possible? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2013 08:44:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109575#M28589</guid>
      <dc:creator>lukasz92</dc:creator>
      <dc:date>2013-11-04T08:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a lookup for timechart headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109576#M28590</link>
      <description>&lt;P&gt;I imagine you could achieve this using the new &lt;CODE&gt;foreach&lt;/CODE&gt; command that exists in Splunk 6.0 and onwards: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2013 10:21:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109576#M28590</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-11-04T10:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a lookup for timechart headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109577#M28591</link>
      <description>&lt;P&gt;I have found a way to do this, sort of. I did an untable that was recommended to be able to search a timechart. &lt;BR /&gt;
So in yours, you would most likely need something like the following:&lt;BR /&gt;
&lt;CODE&gt;sflow | eval bytes = formatbytestom(bytes) | timechart limit=50 sum(bytes) by src_ip | untable _time, src_ip, sum | lookup ip_lookup ip as src_ip output host as src_ip | timechart sum(sum) by host&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You may have to play with it but that is the basis of what I did. Untable will pull the header values into a column, manipulate that, and then put it back into a timechart. &lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 00:25:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109577#M28591</guid>
      <dc:creator>jsilverbears</dc:creator>
      <dc:date>2016-05-06T00:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a lookup for timechart headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109578#M28592</link>
      <description>&lt;P&gt;Only problem with the above is that OTHER from the first timechart will come back with NULL in the second since OTHER is probably not in your lookup. If you put the lookup translation in there as well, it should work.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 00:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109578#M28592</guid>
      <dc:creator>jsilverbears</dc:creator>
      <dc:date>2016-05-06T00:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a lookup for timechart headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109579#M28593</link>
      <description>&lt;P&gt;What if you did the &lt;CODE&gt;lookup&lt;/CODE&gt; before the &lt;CODE&gt;timechart&lt;/CODE&gt; command and change the  &lt;CODE&gt;timechart&lt;/CODE&gt; command to group by hostname. Something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sflow | eval bytes = formatbytestom(bytes) | lookup ip_lookup ip as src_ip output host as hostname | timechart limit=50 sum(bytes) by hostname 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 May 2016 01:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109579#M28593</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-06T01:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to do a lookup for timechart headers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109580#M28594</link>
      <description>&lt;P&gt;That was my first thought but I noticed this in the description of the problem:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;The problem is I dont't want to resolve all hostnames before drawing a chart (some thousands of ip addresses - it'd take many minutes), only top ten just after selecting top ten addresses.&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So I did not give that as a response.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2016 16:05:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-do-a-lookup-for-timechart-headers/m-p/109580#M28594</guid>
      <dc:creator>jsilverbears</dc:creator>
      <dc:date>2016-05-06T16:05:37Z</dc:date>
    </item>
  </channel>
</rss>

