---
title: "NetWitness Retention Script: Understanding The Numbers"
description: Overview If you are looking at retention requirements for compliance, making decisions about the architecture, or to retain a decent investigation his
---

- [Home](https://mydev.netwitness.com/home)
- Integrations 
    - [Netwitness Platform Integrations](https://mydev.netwitness.com/netwitnessplatformintegrations)
    - [Third Party Integrations](https://mydev.netwitness.com/thirdpartyintegrations)
- [Knowledge Center](https://mydev.netwitness.com/knowledge-base)
- Community 
    - [Blogs](https://mydev.netwitness.com/netwitness-security-llc-blog)
    - Discussions
- Customers 
    - [Manage Products and Licenses](https://mydev.netwitness.com/nwportal)
    - Downloads
- Partners 
    - [Partner Program](https://mydev.netwitness.com/partner)
    - [Partner Resources](https://mydev.netwitness.com/partnerresources)
    - [Submit a New Deal Registration](https://mydev.netwitness.com/dealregistration)
    - [Become a Partner](https://mydev.netwitness.com/becomeapartner)
    - [Update Your Partner Locator Profile](https://www.netwitness.com/partner-locator/?utm_source=pardotnewsletter&utm_medium=email&utm_campaign=partner_march)
    - [NetWitness LinkedIn Partner Hub](https://linkedin.com/showcase/netwitnesspartners/)
- Education 
    - [Instructor Led Training Schedule](https://mydev.netwitness.com/instructorledtrainingschedule)
    - [NetWitness Training Catalog](https://mydev.netwitness.com/netwitnesstrainingcatalog)
    - [Security Awareness Training](https://mydev.netwitness.com/securityawarenesstraining)
    - [New Product Readiness](https://mydev.netwitness.com/newproductreadiness)
    - [On-Demand Virtual Labs](https://mydev.netwitness.com/ondemandvirtuallabs)
    - [Additional Training Information](https://mydev.netwitness.com/additionaltraininginformation)
    - [Frequently Asked Questions](https://mydev.netwitness.com/educationfaq)
    - [Contact NetWitness Education Team](https://mydev.netwitness.com/contact-netwitness-education-team)
- Support 
    - [Contact Support](https://mydev.netwitness.com/contact-support)
    - [Create a New Case](https://mydev.netwitness.com/create-support-case)
    - [View My Cases](https://mydev.netwitness.com/viewmycase)
    - [Product Version Life Cycle](https://mydev.netwitness.com/product-version-life-cycle)
    - [Warranty & Replacement Parts](https://mydev.netwitness.com/warranty-and-replacement-parts)
    - [Community Support Forum](https://mydev.netwitness.com/community-support-forum)
    - [Technical Support Guide](https://mydev.netwitness.com/technical-support-guide)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

![search](https://21725316.fs1.hubspotusercontent-na1.net/hubfs/21725316/Ladder/Image/search.svg)

# NetWitness Retention Script: Understanding The Numbers

- Home
 */*- [Netwitness blogs](https://mydev.netwitness.com/netwitness-security-llc-blog)
*/*- netwitness retention script: understanding the numbers

 19 Jan, 2021

**Author:** Anonymous

## Overview

If you are looking at retention requirements for compliance, making decisions about the architecture, or to retain a decent investigation history, NetWitness retention is always at the top of these discussions.  As we all find out over time, retention is something that needs to be monitored for trends so informed decisions can be made to meet the corporate or regulatory retention requirements.  This article will shed some light on retention in the NetWitness Platform Systems and demonstrate how to view the retention numbers as a “stack”.  Scroll to the bottom to download the retention script related to this article.

## Persistence

There are basically two levels of persistence in the NetWitness Platform:

- ***Permanent*** - Final resting place for the data - It is NOT copied to another destination in the platform; i.e Network/Log Decoder raw packets/logs residing on the Network/Log Decoder
- ***Temporary*** - Data that is copied (via aggregation) from this location to another device, i.e. The Concentrator consuming meta and sessions data from a Network/Log Decoder.  The meta and session data is considered temporary as only needs to reside on the Network/Log Decoder long enough to be consumed by the aggregating Concentrator.

## Database Types

Below are the database types and the index used by the NetWitness Platform

- ***PacketDB*** – Raw captured log/network data  
  Present on Log/Network Decoders and Archivers
- ***MetaDB*** – Meta data generated from Log/Network Decoder parsing and processing (App Rules/Feeds)  
  Present on Log/Network Decoders, Concentrators and Archivers
- ***SessionDB*** – Data that links the meta data and packet data together into sessions  
  Present on Log/Network Decoders, Concentrators and Archivers
- ***Index*** – Not really a database, but provides a method to lookup sessions using meta key values or session ID's.

## NetWitness Systems

Let's take a look at how the database types, persistence, and the retention requirements relate to the individual NetWitness Systems.  

## Log/Network Decoder

- ***PacketDB*** 
    - **Permanent** resting place (unless Log Archiver is deployed for Log Decoder) 
          - **Meet Your Requirement Retention Days**
- ***MetaDB*** 
    - **Temporary** resting place 
          - Typically like to see ~30 Days Retention

- ***SessionDB*** 
    - **Temporary** resting place 
          - Typically like to see ~30 Days Retention

## Concentrator

- ***MetaDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***SessionDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***Index*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**

## Log Archiver

- ***PacketDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***MetaDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***SessionDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***Index*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**

## Log Hybrid Retention

- ***PacketDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***MetaDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***SessionDB*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**
- ***Index*** 
    - **Permanent** Resting Place 
          - **Meet Your Requirement Retention Days**

## Interpreting The Numbers

## Viewing The "Stack"

When examining retention it is best to evaluate the systems as a "stack".  This will assist in viewing the relationship between the capture devices (Network/Log Decoders) and the upstream consumers (Concentrators) of the data in relation to the corporate goal or regulatory requirement.  The image below shows the NetWitness "stacks" in this particular sample architecture.  Each individual stack is separated by the "----------", so we can see that there are 15 stacks, two of which are archivers.

![The-Full-Estate-Table.png](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/30699i64817EBF4084E200.png "The-Full-Estate-Table.png")

## Determine The Retention

Determine if your goals or requirements are met by viewing the "Permanent" retention numbers.  \*Note the Archiver permanent numbers are relative to a "Collection" name, there will always be a "default" collection.  If there were other collections, the row for each collection would be the "Permanent" retention numbers. 

![The-Full-Estate-Table2.png](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/30700i1D6AD9C1F0830CFF.png "The-Full-Estate-Table2.png")

## The Retention Script

Attached is the retention script used to provide the outputs shown above.

The script provides output to file in two text formats and outputs to local and/or syslog target:

- Table for console viewing (text format)
- CSV for use in other programs
- Syslog (CEF Format), it can send to a syslog target (unencrypted only - Logger limitation)
- It writes the output to /var/log/messages (CEF Format)

## Requirements

In order for the script file to function as designed, you will need the following prerequisites:

- Install the [NwBackup script](https://community.rsa.com/docs/DOC-106140), particularly the following scripts: 
    - Run get-all-systems11.sh
    - Run ssh-propagate11.sh

## Installation

1. Download the retention script at the end of this article
2. SSH to the console of the NetwWitness Server (Node Zero)
3. Login as the "root" user
4. Create the /root/scripts/admin   
   ***mkdir /root/scripts***  
   ***mkdir /root/scripts/admin***
5. Create the retention directories to store the output files (these are the defaults).  
   ***mkdir /root/retention***  
   ***mkdir /root/retention/table***  
   ***mkdir /root/retention/csv***
6. Using WinSCP or other client to copy the script to the NetWitness Server (Node Zero) /root/scripts/admin directory
7. Make the script file executable  
   ***chmod +x /root/scripts/admin/netwitness\_retention\_csv.sh***
8. Edit the script file variable values to match your output directories, syslog server, and number of history days to keep for the CSV and table text files.

## Manual Execution

1. SSH to the console of the NetwWitness Server (Node Zero)
2. Login as the "root" user
3. After you have completed the Installation Steps, type the following command  
   ***/root/scripts/admin/netwitness\_retention\_csv.sh***
4. You will see ouput to the console similar to below

![script-output.png](https://mydev.netwitness.com/hubfs/Imported_Blog_Media/30701i4AF75E52AA9129DB.png "script-output.png")

## Crontab Scheduling Instructions

1. SSH to NetWitness Server (Node-zero)
2. Login as "root"
3. Edit crontab  
   ***crontab -e***
4. Add to crontab to execute once every 24 hours at 11pm UTC  
   Press the following key  
   ***Insert***  
   add the following text at the top or the bottom of the file  
   ***## Retention Script ##***  
   ***0 23 \* \* \* /root/scripts/admin/netwitness\_retention\_csv.sh***  
   Press  
   ***ESC***  
   Type the following keys  
   ***:wq***  
   Press  
   ***ENTER***

## Additional Notes

Since this data is now passed to the /var/log/messages it can ingested by the Log Decoder and partially parsed.  To completely parse the logs into meta and report on it with the reporting engine, check out [NetWitness Retention Script: Reporting The Numbers.](https://community.rsa.com/t5/rsa-netwitness-platform-blog/netwitness-retention-script-reporting-the-numbers/ba-p/609926)

 Topic:

[0 Comment](https://mydev.netwitness.com/netwitness-security-llc-blog/netwitnessretentionscript-understandingthenumbers#comments-listing)

###### CATEGORIES

- All
- [Blog](https://mydev.netwitness.com/netwitness-security-llc-blog/tag/blog)

##### RECENT POST

[Netwitness Platform Integration with AWS Application Load Balancer Access logs](https://mydev.netwitness.com/netwitness-security-llc-blog/netwitnessplatformintegrationwithawsapplicationloadbalanceraccesslogs)

 23 Jul, 2024

[The Sky Is Crying: The Wake of the 19 JUL 2024 CrowdStrike Content Update for Microsoft Windows and We Should Take Away From It](https://mydev.netwitness.com/netwitness-security-llc-blog/715124)

 20 Jul, 2024

[DDoS using BotNet Use Case](https://mydev.netwitness.com/netwitness-security-llc-blog/ddosusingbotnetusecase)

 7 May, 2024

[NetWitness Platform](https://www.netwitness.com/)

[Acceptable Use Policy](https://www.netwitness.com/wp-content/uploads/Acceptable-Use-Policy-092022.pdf) [Privacy Statement](https://www.netwitness.com/wp-content/uploads/NetWitness-Privacy-Statement-07292024.pdf)

![NetWitness Logo](https://mydev.netwitness.com/hubfs/Portal-Partner%20Program/netwitness-logo-RGB-white%201.png)

[![LinkedIn](https://mydev.netwitness.com/hubfs/Portal-Partner%20Program/linkedin.png)](https://www.linkedin.com/company/netwitness-platform/) [![YouTube](https://mydev.netwitness.com/hubfs/Portal-Partner%20Program/Youtube.jpg)](https://www.youtube.com/@netwitness)

© 2026 NetWitness LLC. All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Anonymous",
    "url" : "https://mydev.netwitness.com/netwitness-security-llc-blog/author/anonymous"
  },
  "dateModified" : "2026-03-20T11:01:19.262Z",
  "datePublished" : "2021-01-19T05:00:00.000Z",
  "headline" : "NetWitness Retention Script: Understanding The Numbers",
  "mainEntityOfPage" : {
    "@id" : "https://mydev.netwitness.com/netwitness-security-llc-blog/netwitnessretentionscript-understandingthenumbers",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://mydev.netwitness.com/hubfs/netwitness-logo-CMYK.jpg"
    }
  }
}
```