<?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: 2 different fields from different csv. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343545#M63256</link>
    <description>&lt;P&gt;hi rich7177, thanks for your time in answering my question. It does not return the results I want. I used lookup table for the 1st csv file.&lt;BR /&gt;
this is my search command. Can you tell me what is wrong on the command? Thanks. Newbie splunk user here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;|inputlookup cams.csv&lt;BR /&gt;
| join type=left EID&lt;BR /&gt;
[search index="cams_2" sourcetype="cams2_csv" "Capability Cycle 9" = "Data &amp;amp; Analytics" OR "LocalCapabilityRollUp Cycle 9" = "Data &amp;amp; Analytics" OR "Capability Cycle 10" = "Data &amp;amp; Analytics" OR "LocalCapabilityRollUp Cycle 10" = "Data &amp;amp; Analytics"]&lt;BR /&gt;
| fields "Resource Name"&lt;BR /&gt;
| dedup "Resource Name"&lt;BR /&gt;
| rename "Resource Name" as EID&lt;BR /&gt;
| eval "CoDp Mapping"=if(isnotnull(EID),1,0)&lt;/P&gt;

&lt;P&gt;the result it returns are all 1, though not every eid has a match in resource name.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 13:09:48 GMT</pubDate>
    <dc:creator>mrccasi</dc:creator>
    <dc:date>2020-09-29T13:09:48Z</dc:date>
    <item>
      <title>2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343543#M63254</link>
      <description>&lt;P&gt;Hi. can you please help me in making a search command for the below result?&lt;BR /&gt;
"resource name" is a field name of my csv file then "eid" is a field name of another csv file. I would like to compare the values of both field and if they are the same the value in "codp" should be 1. if they dont match the value is 0.&lt;/P&gt;

&lt;P&gt;kindly help me.&lt;/P&gt;

&lt;P&gt;resource name   eid                         codp&lt;BR /&gt;
mary.rose.c.casi    mary.rose.c.casi    1&lt;BR /&gt;
                            ley                         0&lt;BR /&gt;
ghi                                                     0&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 06:48:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343543#M63254</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2017-03-09T06:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: 2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343544#M63255</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;sourcetype1 OR sourcetype2
| rename "resource name" AS eid
| transaction maxspan=5m eid
| eval codp=if(eventcount&amp;gt;1,1,0)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That uses transaction, which could be improved from a performance standpoint with stats (especially in a clustered environment, not so much in a single machine one).  Not knowing how you will put this to use I wasn't sure what would be easier, but I think transaction is more clear from an example usage.  Adjust &lt;CODE&gt;maxspan=X&lt;/CODE&gt; to as short as will work (keeps it efficient).&lt;/P&gt;

&lt;P&gt;You may need the first line to be something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=X AND eid=*) OR (sourcetype=Y AND index=Z)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's a list of the criteria you need to show the first set of data ORed with the criteria you need to show the second set of data so they all show up together.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2017 12:35:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343544#M63255</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2017-03-09T12:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: 2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343545#M63256</link>
      <description>&lt;P&gt;hi rich7177, thanks for your time in answering my question. It does not return the results I want. I used lookup table for the 1st csv file.&lt;BR /&gt;
this is my search command. Can you tell me what is wrong on the command? Thanks. Newbie splunk user here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;|inputlookup cams.csv&lt;BR /&gt;
| join type=left EID&lt;BR /&gt;
[search index="cams_2" sourcetype="cams2_csv" "Capability Cycle 9" = "Data &amp;amp; Analytics" OR "LocalCapabilityRollUp Cycle 9" = "Data &amp;amp; Analytics" OR "Capability Cycle 10" = "Data &amp;amp; Analytics" OR "LocalCapabilityRollUp Cycle 10" = "Data &amp;amp; Analytics"]&lt;BR /&gt;
| fields "Resource Name"&lt;BR /&gt;
| dedup "Resource Name"&lt;BR /&gt;
| rename "Resource Name" as EID&lt;BR /&gt;
| eval "CoDp Mapping"=if(isnotnull(EID),1,0)&lt;/P&gt;

&lt;P&gt;the result it returns are all 1, though not every eid has a match in resource name.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:09:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343545#M63256</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2020-09-29T13:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: 2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343546#M63257</link>
      <description>&lt;P&gt;OK, so I think I see some things wrong, but could you paste in one or two events of each type?  One from the inputlookup and one from the cams_2 sourcetype of the appropriate type?  I think this will be easier than guessing...  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Be sure to paste them in using the code button (the 101010 button at the top of the editor window).&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
-Rich&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 12:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343546#M63257</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2017-03-10T12:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: 2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343547#M63258</link>
      <description>&lt;P&gt;Here are the events in inputlookup&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Capability  FY         Resource Name
Microsoft   FY15    arnold.b.o.alegarbes
Microsoft   FY15    jennifer.garcia
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and here are the events for cams_csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SAP ID          Personnel Name          EID
10027   Arnold Alegarbes    arnold.b.o.alegarbes
10816   Maricar Reyes           maricar.reyes
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Mar 2017 01:40:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343547#M63258</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2017-03-15T01:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: 2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343548#M63259</link>
      <description>&lt;P&gt;So, if you use a &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Lookup" target="_blank"&gt;lookup&lt;/A&gt; instead of an inputlookup, you might be able to do this more easily.  Please excuse me only giving pseudo-SPL ... There will be a little homework but if you get stuck I or others of us can probably help.  I may have the two data types backwards, so you might need to flop it.  (You say one of the above two is the inputlookput, which is named cams.csv, and the other is for cams_csv so I'm not sure which is actually which, assuming cams_csv is sourcetype cams2_csv)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search index="cams_2" sourcetype="cams2_csv" "Capability Cycle 9" = "Data &amp;amp; Analytics" OR "LocalCapabilityRollUp Cycle 9" = "Data &amp;amp; Analytics" OR "Capability Cycle 10" = "Data &amp;amp; Analytics" OR "LocalCapabilityRollUp Cycle 10" = "Data &amp;amp; Analytics"
| lookup cams.csv "Resource Name" AS EID OUTPUTNEW FY Capability
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At this point you should have individual events that have BOTH "sets" of records in them.  At least probably.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;So, to the above, you can do things.  Like, for only records that have FY, add to the end &lt;CODE&gt;| search FY=*&lt;/CODE&gt;.  Doing that ought to then only give you records where they match up (because if they don't match, that will filter it out).  Or you could ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval hasTwoRecords=if(isnull(FY),0,1) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which, unless I have my 1/0 backwards, should give you a new field &lt;CODE&gt;hasTwoRecords&lt;/CODE&gt; which when set to 1 means you have both records, if not then there was no corresponding cams.csv record.&lt;/P&gt;

&lt;P&gt;The sky's the limit, hopefully this will get your juices flowing.  &lt;/P&gt;

&lt;P&gt;If you need more help, please "redescribe" which is the inputlookup and which is the events in the index.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:17:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343548#M63259</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2020-09-29T13:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: 2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343549#M63260</link>
      <description>&lt;P&gt;Hi rich7177, thank you so much for helping me and giving me ideas &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It helps me a lot.&lt;/P&gt;

&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 02:16:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343549#M63260</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2017-03-20T02:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: 2 different fields from different csv.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343550#M63261</link>
      <description>&lt;P&gt;I am glad I could help.  'if helpful enough, could you please mark this "Accepted" so others know the solution is in this answer somewhere?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 14:43:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/2-different-fields-from-different-csv/m-p/343550#M63261</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2017-03-24T14:43:45Z</dc:date>
    </item>
  </channel>
</rss>

