<?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 write a search using a CSV file to display a list of lent materials by user based on status? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233511#M69334</link>
    <description>&lt;P&gt;Assuming you already have the fields extracted from your csv type data, try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search status=lent | stats list(material) as material list(date) as date by username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 04 Mar 2016 15:15:19 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-03-04T15:15:19Z</dc:date>
    <item>
      <title>How to write a search using a CSV file to display a list of lent materials by user based on status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233510#M69333</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a list of assets like this:&lt;/P&gt;

&lt;P&gt;date,material,username,status&lt;BR /&gt;
 01/12/15,"IPad #4654654",eric,lent&lt;BR /&gt;
 01/12/15,"Iphone #4547879",paul,lent&lt;BR /&gt;
 01/15/15,"IPad #4654654",eric,return&lt;BR /&gt;
 01/16/15,"Keyboard #454456",eric,lent&lt;BR /&gt;
 01/17/15,"Nexus 7 #414456",eric,lent&lt;/P&gt;

&lt;P&gt;and I would like to extract the list of materials that are actually lent by user. In this case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eric   Keyboard   #454456    01/16/15
       Nexus 7    #414456    01/17/15
paul   Iphone     #4547879   01/12/15
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How I can do this? &lt;/P&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 10:56:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233510#M69333</guid>
      <dc:creator>erichard</dc:creator>
      <dc:date>2016-03-04T10:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search using a CSV file to display a list of lent materials by user based on status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233511#M69334</link>
      <description>&lt;P&gt;Assuming you already have the fields extracted from your csv type data, try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search status=lent | stats list(material) as material list(date) as date by username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:15:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233511#M69334</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-04T15:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search using a CSV file to display a list of lent materials by user based on status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233512#M69335</link>
      <description>&lt;P&gt;Thanks for your answer, but it's not working as i need, with your answer i have : &lt;/P&gt;

&lt;P&gt;eric    &lt;STRONG&gt;IPad #4654654&lt;/STRONG&gt;&lt;BR /&gt;
       Keyboard #454456&lt;BR /&gt;
       Nexus 7 #414456&lt;/P&gt;

&lt;P&gt;The material IPad has beed returned (01/15/15,"IPad #4654654",eric,return) however it shouldn't appear.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:29:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233512#M69335</guid>
      <dc:creator>erichard</dc:creator>
      <dc:date>2016-03-04T15:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search using a CSV file to display a list of lent materials by user based on status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233513#M69336</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv mycsv.csv
| eval statusInteger = if(match(status,"lent"), 1, -1)
| eval date = strptime(date, "%m/%d/%y")
| stats sum(statusInteger) as status, max(date) as date by username, material
| where status != 0 
| fields - status
| fieldformat date=strftime(date, "%m/%d/%y")
| stats list(material) as material, list(date) as date by username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1110iB81894905B230519/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:30:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233513#M69336</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-03-04T15:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search using a CSV file to display a list of lent materials by user based on status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233514#M69337</link>
      <description>&lt;P&gt;Thanks it's working !&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:44:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-using-a-CSV-file-to-display-a-list-of-lent/m-p/233514#M69337</guid>
      <dc:creator>erichard</dc:creator>
      <dc:date>2016-03-04T15:44:58Z</dc:date>
    </item>
  </channel>
</rss>

