<?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: I have 2 files in csv format. I want to search whether one of the unique field is present in second file. in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606339#M49776</link>
    <description>&lt;P&gt;Thanks for the reply. If i have the same field name in both the files by which command can i mark the new field as true if existing in second file else false. Can i use&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2022 12:50:16 GMT</pubDate>
    <dc:creator>yuvasree</dc:creator>
    <dc:date>2022-07-20T12:50:16Z</dc:date>
    <item>
      <title>2 files in csv format: How to search whether one of the unique field is present in second file?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606327#M49774</link>
      <description>&lt;P&gt;I have 2 files in csv format. I want to search whether one of the unique field is present in second file. if it is present mark the value as true else false. Kindly help with the command&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 15:23:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606327#M49774</guid>
      <dc:creator>yuvasree</dc:creator>
      <dc:date>2022-07-21T15:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: I have 2 files in csv format. I want to search whether one of the unique field is present in second file.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606332#M49775</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247848"&gt;@yuvasree&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it depends on one detail:&lt;/P&gt;&lt;P&gt;do you want to search the values from the first csv ina field of the second or as free text search?&lt;/P&gt;&lt;P&gt;supponing that both the csv were uploaded in an index (your_index) with two sourcetypes (sourcetype1 and sourcetype2).&lt;/P&gt;&lt;P&gt;if in a field and they are named field1 (in sourcetype1) and field2 (in sourcetype2), you have to run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index sourcetype=sourcetype1 [ | search index=your_index sourcetype=sourcetype2 | rename field2 AS field1 | fields field1 ]
| ...&lt;/LI-CODE&gt;&lt;P&gt;the most important thing is that the field name at the end of the subsearch is the same of the main search.&lt;/P&gt;&lt;P&gt;If instead you want to performa a free text search, you have to run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index sourcetype=sourcetype1 [ | search index=your_index sourcetype=sourcetype2 | rename field2 AS query | fields query ]
| ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 12:17:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606332#M49775</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-07-20T12:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: I have 2 files in csv format. I want to search whether one of the unique field is present in second file.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606339#M49776</link>
      <description>&lt;P&gt;Thanks for the reply. If i have the same field name in both the files by which command can i mark the new field as true if existing in second file else false. Can i use&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 12:50:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606339#M49776</guid>
      <dc:creator>yuvasree</dc:creator>
      <dc:date>2022-07-20T12:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: I have 2 files in csv format. I want to search whether one of the unique field is present in second file.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606340#M49777</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247848"&gt;@yuvasree&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in this way you filter results and you take only the one present in both the searches.&lt;/P&gt;&lt;P&gt;if you want to mark as present or not present, you have to run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (sourcetype=sourcetype1 OR sourcetype=sourcetype2
| stats values(*) AS * dc(sourcetype) AS sourcetype_count BY field
| eval status=if(sourcetype_count=2,"Both",if(sourcetype="sourcetype1","sourcetype2"))
| table field status&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 13:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606340#M49777</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-07-20T13:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: I have 2 files in csv format. I want to search whether one of the unique field is present in second file.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606487#M49779</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; Thanks for the prompt response. It worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when i am executing the provided command getting the error in eval as malformed function. But if I execute like this it works fine. How can i validate the source file name as well so that it won't have wrong result if duplicates present.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval status=if(sourcetype_count=2,"Both","Not present")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 12:11:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606487#M49779</guid>
      <dc:creator>yuvasree</dc:creator>
      <dc:date>2022-07-21T12:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: I have 2 files in csv format. I want to search whether one of the unique field is present in second file.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606489#M49780</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/247848"&gt;@yuvasree&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;yes i frgot a piece:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index (sourcetype=sourcetype1 OR sourcetype=sourcetype2
| stats values(*) AS * dc(sourcetype) AS sourcetype_count BY field
| eval status=if(sourcetype_count=2,"Both",if(sourcetype="sourcetype1","sourcetype1","sourcetype2"))
| table field status&lt;/LI-CODE&gt;&lt;P&gt;Anyway,&amp;nbsp;&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 12:15:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/2-files-in-csv-format-How-to-search-whether-one-of-the-unique/m-p/606489#M49780</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-07-21T12:15:45Z</dc:date>
    </item>
  </channel>
</rss>

