<?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: help on a jointure without join command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487135#M193794</link>
    <description>&lt;P&gt;I have identified the issue&lt;BR /&gt;
when i execute the code below, I have results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| inputlookup host.csv 
    | table host ] (`LastLogonBoot`) OR (`wire`) earliest=-24h latest=now 
| fields host SystemTime EventCode USERNAME NAME AP_NAME 
| lookup toto.csv NAME as AP_NAME OUTPUT Building 
| eval SystemTime=strptime(SystemTime, "'%Y-%m-%dT%H:%M:%S.%9Q%Z'") 
| stats latest(SystemTime) as SystemTime by host EventCode 
| xyseries host EventCode SystemTime 
| rename "6005" as LastLogon "6006" as LastReboot 
| eval NbDaysReboot=round((now() - LastReboot )/(3600*24), 0) 
| eval LastReboot=strftime(LastReboot, "%y-%m-%d %H:%M") 
| lookup tutu.csv HOSTNAME as host output SITE BUILDING_CODE DESCRIPTION_MODEL ROOM STATUS  
| stats last(LastReboot) as "Last reboot date", last(NbDaysReboot) as "Days without reboot", last(DESCRIPTION_MODEL) as Model, last(SITE) as Site, last(BUILDING_CODE) as Building, last(ROOM) as Room, last(STATUS) as Status by host 
| sort -"Days without reboot"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But like in &lt;CODE&gt;wire&lt;/CODE&gt; the field "host" is called "USERNAME", I need to add a | rename USERNAME as host&lt;BR /&gt;
But when I am doing this, I have no results and I dont understand why&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 07:22:24 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2020-03-05T07:22:24Z</dc:date>
    <item>
      <title>help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487127#M193786</link>
      <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;I use the complex search below&lt;BR /&gt;
As you can see, there i a subsearch linked with a join command&lt;BR /&gt;
I find a way to do the same search but without the join command&lt;BR /&gt;
I started to write this search (see below) but I have an issue because the field "host" in  &lt;CODE&gt;wire&lt;/CODE&gt;is called "USERNAME"&lt;BR /&gt;
So I need to do | rename USERNAME as host but it doesnt works and as a consequence I am unable to do a "stats by" after&lt;BR /&gt;
Is anybody can help me??&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`wire` earliest=-30d latest=now 
    | fields USERNAME NAME Building AP_NAME 
    | rename USERNAME as host 
    | eval host=upper(host) 
    | lookup toto.csv NAME as AP_NAME OUTPUT Building 
    | eval Building=upper(Building) 
    | stats last(AP_NAME) as "AP", last(Building) as "Geol" by host 
    **| join host type=outer** 
        [| search `LastLogonBoot` earliest=-30d latest=now 
        | fields host SystemTime EventCode 
        | eval SystemTime=strptime(SystemTime, "'%Y-%m-%dT%H:%M:%S.%9Q%Z'") 
        | stats latest(SystemTime) as SystemTime by host EventCode 
        | xyseries host EventCode SystemTime 
        | rename "6005" as LastLogon "6006" as LastReboot 
        | eval NbDaysReboot=round((now() - LastReboot )/(3600*24), 0) 
        | eval LastReboot=strftime(LastReboot, "%y-%m-%d %H:%M") 
        | lookup tutu.csv HOSTNAME as host output SITE BUILDING_CODE DESCRIPTION_MODEL ROOM STATUS 
        | stats last(LastReboot) as "Last reboot date", last(NbDaysReboot) as "Days without reboot", last(DESCRIPTION_MODEL) as Model, last(SITE) as Site, last(AP_NAME) as AP, last(BUILDING_CODE) as Building, last(ROOM) as Room, last(STATUS) as Status by host ] 
    | search "Days without reboot" &amp;gt; 5 
    | search Site = *
    | rename host as Hostname 
    | table Hostname Model Status "Days without reboot" "Last reboot date" Site Building Room AP Geol
    | sort -"Days without reboot"




 [| inputlookup host.csv 
        | table host 
            ] (`LastLogonBoot`) OR (`wire`) earliest=-24h latest=now 
    | fields host SystemTime EventCode USERNAME NAME AP_NAME 
**| rename USERNAME as host**
    | lookup tutu.csv NAME as AP_NAME OUTPUT Building 
    | eval SystemTime=strptime(SystemTime, "'%Y-%m-%dT%H:%M:%S.%9Q%Z'") 
    | stats latest(SystemTime) as SystemTime by host EventCode 
    | xyseries host EventCode SystemTime 
    | rename "6005" as LastLogon "6006" as LastReboot 
    | eval NbDaysReboot=round((now() - LastReboot )/(3600*24), 0) 
    | eval LastReboot=strftime(LastReboot, "%y-%m-%d %H:%M") 
    | lookup toto.csv HOSTNAME as host output SITE BUILDING_CODE DESCRIPTION_MODEL ROOM STATUS 
    | stats last(LastReboot) as "Last reboot date", last(NbDaysReboot) as "Days without reboot", last(DESCRIPTION_MODEL) as Model, last(SITE) as Site, last(BUILDING_CODE) as Building, last(ROOM) as Room, last(STATUS) as Status by host 
    | sort -"Days without reboot"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Mar 2020 14:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487127#M193786</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-04T14:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487128#M193787</link>
      <description>&lt;P&gt;Hi @jip31,&lt;BR /&gt;
use your subsearch as the main search and join the lookup using the lookup command that's similar to the left join command.&lt;BR /&gt;
I cannot test it, but thge approach is something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(first search) OR (second search)
| rename fields_of_first_search AS fields_of_the_second_search
| stats values(field1) AS field1 values(field2) AS field2 values(field) AS field3 BY host
| table intersting_fields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 14:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487128#M193787</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-04T14:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487129#M193788</link>
      <description>&lt;P&gt;hi&lt;BR /&gt;
I done this but no results&lt;BR /&gt;
    (&lt;CODE&gt;wire&lt;/CODE&gt;) OR (&lt;CODE&gt;LastLogonBoot&lt;/CODE&gt;) &lt;BR /&gt;
    | fields USERNAME NAME Building AP_NAME host SystemTime EventCode &lt;BR /&gt;
    | rename USERNAME as host &lt;BR /&gt;
    | eval host=upper(host) &lt;BR /&gt;
    | lookup toto.csv NAME as AP_NAME OUTPUT Building &lt;BR /&gt;
    | eval Building=upper(Building) &lt;BR /&gt;
    | eval SystemTime=strptime(SystemTime, "'%Y-%m-%dT%H:%M:%S.%9Q%Z'") &lt;BR /&gt;
    | xyseries host EventCode SystemTime &lt;BR /&gt;
    | rename "6005" as LastLogon "6006" as LastReboot &lt;BR /&gt;
    | eval NbDaysReboot=round((now() - LastReboot )/(3600*24), 0) &lt;BR /&gt;
    | eval LastReboot=strftime(LastReboot, "%y-%m-%d %H:%M") &lt;BR /&gt;
    | lookup tutu.csv HOSTNAME as host output SITE BUILDING_CODE DESCRIPTION_MODEL ROOM STATUS &lt;BR /&gt;
    | stats latest(SystemTime) as SystemTime last(AP_NAME) as "Access point", last(Building) as "Geolocation building", last(LastReboot) as "Last reboot date", last(NbDaysReboot) as "Days without reboot", last(DESCRIPTION_MODEL) as Model, last(SITE) as Site, last(BUILDING_CODE) as Building, last(ROOM) as Room, last(STATUS) as Status by host EventCode &lt;BR /&gt;
    | search "Days without reboot" &amp;gt; 5&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487129#M193788</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-30T04:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487130#M193789</link>
      <description>&lt;P&gt;Hi @jip31,&lt;BR /&gt;
check if the fields you used in xyseriers and stats commands are present in all the events, probably it isn't correct some rename.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 15:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487130#M193789</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-04T15:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487131#M193790</link>
      <description>&lt;P&gt;Yes they are..&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 15:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487131#M193790</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-04T15:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487132#M193791</link>
      <description>&lt;P&gt;Hi @jip31,&lt;BR /&gt;
at first see if without the last filter ( &lt;CODE&gt;| search "Days without reboot" &amp;gt; 5&lt;/CODE&gt; ) you have events.&lt;/P&gt;

&lt;P&gt;Then see if after the xyseries you still have &lt;CODE&gt;host&lt;/CODE&gt; and &lt;CODE&gt;EventCode&lt;/CODE&gt; fields (to do this delete all the rows until xyseries command).&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 15:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487132#M193791</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-04T15:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487133#M193792</link>
      <description>&lt;P&gt;Hi @jip31,&lt;BR /&gt;
haven't you results after xyseries or haven't you the presence of  host and EventCode fields?&lt;BR /&gt;
in first case analyze fields before xyseries command, in the second try the way to not use xyseries command.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 16:29:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487133#M193792</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-04T16:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487134#M193793</link>
      <description>&lt;P&gt;i have deleted | search "Days without reboot" &amp;gt; 5 for being sure it's not the problem&lt;BR /&gt;
and effectively i have no results after xyseries but i dont know why??&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 06:23:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487134#M193793</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-05T06:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487135#M193794</link>
      <description>&lt;P&gt;I have identified the issue&lt;BR /&gt;
when i execute the code below, I have results&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| inputlookup host.csv 
    | table host ] (`LastLogonBoot`) OR (`wire`) earliest=-24h latest=now 
| fields host SystemTime EventCode USERNAME NAME AP_NAME 
| lookup toto.csv NAME as AP_NAME OUTPUT Building 
| eval SystemTime=strptime(SystemTime, "'%Y-%m-%dT%H:%M:%S.%9Q%Z'") 
| stats latest(SystemTime) as SystemTime by host EventCode 
| xyseries host EventCode SystemTime 
| rename "6005" as LastLogon "6006" as LastReboot 
| eval NbDaysReboot=round((now() - LastReboot )/(3600*24), 0) 
| eval LastReboot=strftime(LastReboot, "%y-%m-%d %H:%M") 
| lookup tutu.csv HOSTNAME as host output SITE BUILDING_CODE DESCRIPTION_MODEL ROOM STATUS  
| stats last(LastReboot) as "Last reboot date", last(NbDaysReboot) as "Days without reboot", last(DESCRIPTION_MODEL) as Model, last(SITE) as Site, last(BUILDING_CODE) as Building, last(ROOM) as Room, last(STATUS) as Status by host 
| sort -"Days without reboot"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But like in &lt;CODE&gt;wire&lt;/CODE&gt; the field "host" is called "USERNAME", I need to add a | rename USERNAME as host&lt;BR /&gt;
But when I am doing this, I have no results and I dont understand why&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 07:22:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487135#M193794</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-05T07:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487136#M193795</link>
      <description>&lt;P&gt;is anybody can help please??&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:14:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487136#M193795</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-05T15:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487137#M193796</link>
      <description>&lt;P&gt;Hi @jip31,&lt;BR /&gt;
USERNAME is present only in wire or also in LastLogonBoot?&lt;BR /&gt;
try to add, instead of &lt;CODE&gt;| rename USERNAME as host&lt;/CODE&gt;, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval host=if(index=wire_index, USERNAME,host)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't know your data, identify a specific field that's only present in wire and not in LastLogonBoot (e.g. index or sourcetype) and use it to assign the correct value to host.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:21:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487137#M193796</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-05T15:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487138#M193797</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
USERNAME is only present in wire&lt;BR /&gt;
Concerning the eval, it doesnt works (Error in 'eval' command: The expression is malformed. Expected )&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 09:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487138#M193797</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-06T09:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487139#M193798</link>
      <description>&lt;P&gt;hi have you an idea please??&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 17:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487139#M193798</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-06T17:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487140#M193799</link>
      <description>&lt;P&gt;hi is anybody can help me please?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 07:02:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487140#M193799</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-09T07:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487141#M193800</link>
      <description>&lt;P&gt;Try &lt;BR /&gt;
 | eval host=if(index="wire_index", USERNAME,host)&lt;BR /&gt;
or search another balue field to identify wire from LastLogonBoot (e.g. index="wire_index").&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487141#M193800</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T04:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: help on a jointure without join command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487142#M193801</link>
      <description>&lt;P&gt;I dont know why you use index in the eval&lt;BR /&gt;
&lt;CODE&gt;wire&lt;/CODE&gt; is a macro which index + sourcetype&lt;BR /&gt;
and I tried many combinaisons with your eval and it doesnt works&lt;BR /&gt;
finally, there is no other field for matching wire and LastLogonBoot &lt;BR /&gt;
If I am doing :&lt;BR /&gt;
    &lt;A href="https://community.splunk.com/%60wire%60"&gt;| inputlookup host.csv &lt;BR /&gt;
        | table host &lt;BR /&gt;
        | rename host as USERNAME&lt;BR /&gt;
            &lt;/A&gt; earliest=-24h latest=now &lt;BR /&gt;
    | rename USERNAME as host &lt;BR /&gt;
    | eval host=upper(host)&lt;/P&gt;

&lt;P&gt;USERNAME is well renamed by host&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 11:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-jointure-without-join-command/m-p/487142#M193801</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-03-09T11:11:53Z</dc:date>
    </item>
  </channel>
</rss>

