<?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: Create a table with _time and a custom fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355374#M105171</link>
    <description>&lt;P&gt;Sorry about the first question.. didn't see your comment under the question. Give my answer a try..&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2017 19:54:24 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-09-22T19:54:24Z</dc:date>
    <item>
      <title>Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355364#M105161</link>
      <description>&lt;P&gt;I'm lost.  I'm trying to capture the _time and UserName (custom field) from a search and use the _time to find events within 1 second in another search.  I would then want to report the result in a simple table: _time; UserName; real_ip_address.&lt;/P&gt;

&lt;P&gt;Any help would be appreciated!  Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:54:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355364#M105161</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2020-09-29T15:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355365#M105162</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/70994"&gt;@dsmithson8812&lt;/a&gt; &lt;/P&gt;

&lt;P&gt;try this,&lt;BR /&gt;
i assume that you have extracted UserName and real_ip_address&lt;/P&gt;

&lt;P&gt;index=x sourcetype=x source=x earliest=-1s latest=now |  regex for UserName and real_ip_address | table _time UserName real_ip_address&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355365#M105162</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2020-09-29T15:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355366#M105163</link>
      <description>&lt;P&gt;I think I need to give you more information.  There are logs for two different hosts, so I have to search one host first to get the event I'm looking for, then I have to take the timestamp and search another host for events within 1 second of the first search.&lt;/P&gt;

&lt;P&gt;Does that make sense?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 17:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355366#M105163</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2017-09-22T17:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355367#M105164</link>
      <description>&lt;P&gt;In other words, I need to correlate two logs based on timestamp. For some reason the title of my post was changed.  It doesn't really capture the gist of what I need here.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 17:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355367#M105164</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2017-09-22T17:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355368#M105165</link>
      <description>&lt;P&gt;do you have any redacted sample logs you could post here as well as the 2 searches you would use manually to find the events of interest in the 2 separate locations? would make it slightly easier to help out&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 18:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355368#M105165</guid>
      <dc:creator>jeremiahc4</dc:creator>
      <dc:date>2017-09-22T18:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355369#M105166</link>
      <description>&lt;P&gt;Search 1:&lt;/P&gt;

&lt;P&gt;host=app* "Login attempt failed" "&lt;A href="https://www.website.org" target="_blank"&gt;https://www.website.org&lt;/A&gt;"&lt;/P&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;P&gt;Sep 22 09:51:05 app1 drupal-prod: &lt;A href="https://www.website.org%7C1506088265%7Cuser%7C123.123.123.123%7Chttps://www.website.org/login_redirect?destination=login_redirect%7Chttps://website.org/%7C0%7C%7CLogin" target="_blank"&gt;https://www.website.org|1506088265|user|123.123.123.123|https://www.website.org/login_redirect?destination=login_redirect|https://website.org/|0||Login&lt;/A&gt; attempt failed for UserName.&lt;/P&gt;

&lt;P&gt;Search 2: This search is run with a _time accelerator of +/- 1 second.&lt;/P&gt;

&lt;P&gt;host=lb* &lt;/P&gt;

&lt;P&gt;Result:&lt;/P&gt;

&lt;P&gt;123.123.123.123 - - [22/Sep/2017:09:51:05 -0400] "POST /login_redirect?destination=login_redirect HTTP/1.1" 403 8707 "&lt;A href="https://website.org/" target="_blank"&gt;https://website.org/&lt;/A&gt;" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0" "124.124.124.124"&lt;/P&gt;

&lt;P&gt;Goal:&lt;/P&gt;

&lt;P&gt;When Search 1 finds a match, get the timestamp and the UserName.  Use the timestamp from Search 1 with +/- 1 second to run Search 2.  Report timestamp, UserName, IP Address.&lt;/P&gt;

&lt;P&gt;In the example above 124.124.124.124 is the real_ip_address extracted.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355369#M105166</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2020-09-29T15:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355370#M105167</link>
      <description>&lt;P&gt;I have posted samples and such as comment to my original post.  Thank you for looking at this.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 18:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355370#M105167</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2017-09-22T18:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355371#M105168</link>
      <description>&lt;P&gt;Can you also post searches to query both the data? How many records do you get from search 1 (which has _time and UserName)?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 19:03:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355371#M105168</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-22T19:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355372#M105169</link>
      <description>&lt;P&gt;Ultimately it's for a real-time search and immediate notification by email.  So it's one record set at a time.&lt;/P&gt;

&lt;P&gt;I didn't understand the first part of your question.  You asked to post searches to query both the data.  I thought I had done that in Search 1 and Search 2. &lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 19:06:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355372#M105169</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2017-09-22T19:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355373#M105170</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=app* "Login attempt failed" "https://www.website.org"
| table _time UserName | eval et=_time-1 | eval lt=_time+2 | map search="search index=_internal host=lb* earliest=$et$ latest=$lt$ | table _time real_ip_address  | eval UserName=\"$UserName$\" "
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Sep 2017 19:53:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355373#M105170</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-22T19:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355374#M105171</link>
      <description>&lt;P&gt;Sorry about the first question.. didn't see your comment under the question. Give my answer a try..&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 19:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355374#M105171</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-22T19:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355375#M105172</link>
      <description>&lt;P&gt;It returns a result, but it has some problems:&lt;/P&gt;

&lt;P&gt;One problem is that it doesn't pull real_ip_address from the second search.  The name of the field is correct, so I'm not sure why it's not there.&lt;/P&gt;

&lt;P&gt;Another problem is that it returns 22 rows in the table.  It should only return 1 row.  &lt;/P&gt;

&lt;P&gt;Oddly (to me anyhow) if I use _time+1 instead of +2, there are no results.  I'm sure there's a good reason for this, but confused by it.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:55:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355375#M105172</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2020-09-29T15:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355376#M105173</link>
      <description>&lt;P&gt;I found that the second search was pulling from the wrong index.  I changed the index to main and now real_ip_address is pulled.  There are some additional problems. The time window designated by earliest and latest is ignored.   Perhaps if you see the results it will be clear.  Here are the redacted results:&lt;/P&gt;

&lt;P&gt;_time                           real_ip_address     UserName&lt;BR /&gt;
2017-09-22T14:24:49.000-0400        -"                  user1&lt;BR /&gt;
2017-09-22T14:24:49.000-0400        10.100.100.100      user1&lt;BR /&gt;
2017-09-22T13:53:03.000-0400        10.100.100.101      user2&lt;BR /&gt;
2017-09-22T13:52:56.000-0400        10.100.100.101      user2&lt;BR /&gt;
2017-09-22T13:52:55.000-0400        -"                  user2&lt;BR /&gt;
2017-09-22T09:51:04.000-0400                            user3&lt;BR /&gt;
2017-09-22T09:51:05.000-0400        10.100.100.102      user3&lt;BR /&gt;
2017-09-22T09:51:05.000-0400        10.100.100.102      user3&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355376#M105173</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2020-09-29T15:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355377#M105174</link>
      <description>&lt;P&gt;When you specify the timerange, latest time-range is exclusive, hence I added 2 to lt. But in that 0.99 sec there might be other events that get caught. Is there any other field that can related/filter results from Search 2? With time as only filter/relation, there is high chance you get other non-relevant results.&lt;BR /&gt;
For real_ip_address, check if you get that field when you run just search2 separately. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355377#M105174</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T15:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a table with _time and a custom fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355378#M105175</link>
      <description>&lt;P&gt;This worked for me after some troubleshooting and tweaking to narrow the scope of the map search.&lt;/P&gt;

&lt;P&gt;Would appreciate if a moderator would name the title of this thread appropriately.  It was renamed by a moderator to something that doesn't fit.&lt;/P&gt;

&lt;P&gt;Thank you somesoni2 et al.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 05:12:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-a-table-with-time-and-a-custom-fields/m-p/355378#M105175</guid>
      <dc:creator>dsmithson8812</dc:creator>
      <dc:date>2017-09-28T05:12:45Z</dc:date>
    </item>
  </channel>
</rss>

