Esempio n. 1
0
            *: {
                // default case...
            }

        }

        switch $info {
            "known malware": { [+#cno.mal] }
        }

    }
    '''
    pars = s_cmd.Parser('synapse.tools.csvtool', description=desc)
    pars.add_argument('--logfile', help='Set a log file to get JSON lines from the server events.')
    pars.add_argument('--csv-header', default=False, action='store_true',
                      help='Skip the first line from each CSV file.')
    pars.add_argument('--cli', default=False, action='store_true',
                      help='Drop into a cli session after loading data.')
    pars.add_argument('--debug', default=False, action='store_true', help='Enable verbose debug output.')
    muxp = pars.add_mutually_exclusive_group(required=True)
    muxp.add_argument('--cortex', '-c', type=str,
                      help='The telepath URL for the cortex ( or alias from ~/.syn/aliases ).')
    muxp.add_argument('--test', '-t', default=False, action='store_true',
                      help='Perform a local CSV ingest against a temporary cortex.')
    pars.add_argument('stormfile', help='A STORM script describing how to create nodes from rows.')
    pars.add_argument('csvfiles', nargs='+', help='CSV files to load.')
    return pars

if __name__ == '__main__': # pragma: no cover
    asyncio.run(s_base.main(main(sys.argv[1:])))
Esempio n. 2
0
                      action='store_true',
                      help='Enable verbose debug output.')
    muxp = pars.add_mutually_exclusive_group(required=True)
    muxp.add_argument(
        '--cortex',
        '-c',
        type=str,
        help='The telepath URL for the cortex ( or alias from ~/.syn/aliases ).'
    )
    muxp.add_argument(
        '--test',
        '-t',
        default=False,
        action='store_true',
        help='Perform a local CSV ingest against a temporary cortex.')
    pars.add_argument(
        '--export',
        default=False,
        action='store_true',
        help=
        'Export CSV data to file from storm using $lib.csv.emit(...) events.')
    pars.add_argument(
        'stormfile',
        help='A STORM script describing how to create nodes from rows.')
    pars.add_argument('csvfiles', nargs='+', help='CSV files to load.')
    return pars


if __name__ == '__main__':  # pragma: no cover
    asyncio.run(s_base.main(main(sys.argv[1:])))